Fixed issue with external DAC handlign from repair process
repair process implemented. Simple regulation without feedback (must be addeed, yet) HW validation menu functional but buggy (IOs not OK) Added ClearLine functionality to displayDevice git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@244 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "Display.h"
|
||||
#include "hwValidationMenu.h"
|
||||
#include "repairMenu.h"
|
||||
#include "repairProcess.h"
|
||||
|
||||
#include "misc.h"
|
||||
@@ -45,7 +46,7 @@
|
||||
#include "nhd0420.h"
|
||||
|
||||
#include "platform.h"
|
||||
#include "adc.h"
|
||||
#include "internalADC.h"
|
||||
#include "gpio.h"
|
||||
#include "IODevice.h"
|
||||
#include "keypadMatrix.h"
|
||||
@@ -88,16 +89,19 @@ static xTaskHandle initTaskHandle;
|
||||
static xTaskHandle ledTaskHandle;
|
||||
static xTaskHandle sysTaskHandle;
|
||||
|
||||
static struct Display _display;
|
||||
static struct Display _display = {.initialized = false};
|
||||
struct Display* display = &_display;
|
||||
|
||||
static struct NHD0420 nhd0420 = {.initialized = false};
|
||||
static struct MAX5715 max5715 = {.initialized = false};
|
||||
static struct RepairProcess _rp = {.initialized = false};
|
||||
|
||||
static struct RepairMenu _rm = {.initialized = false};
|
||||
static struct HwValidationMenu _hwValidation = {.initialized = false};
|
||||
static struct HwValidationMenuItems hwTestItems;
|
||||
|
||||
struct RepairProcess* rp = &_rp;
|
||||
struct MAX5715* dac = &max5715;
|
||||
|
||||
struct RepairMenu* rm = &_rm;
|
||||
struct HwValidationMenu* hwValidation = &_hwValidation;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -120,7 +124,7 @@ int main (void)
|
||||
// Create TaskHandles
|
||||
|
||||
ledTaskArguments.led = ledOrange;
|
||||
ledTaskArguments.frequency = 2;
|
||||
ledTaskArguments.frequency = 1;
|
||||
|
||||
xTaskCreate(initTask, (const char* const)"initTask", 1024, NULL, 5, &initTaskHandle);
|
||||
|
||||
@@ -173,7 +177,9 @@ static ErrorStatus systeminfoCommandHandler(void)
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(keypad->taskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(rp->taskHandle);
|
||||
// OS_logTaskInfo(rp->taskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(rm->taskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(hwValidation->taskHandle);
|
||||
|
||||
@@ -186,11 +192,11 @@ static void initTask(void* parameters)
|
||||
|
||||
xTaskCreate(ledBlinkTask, (const char* const)"ledTask", 100, &ledTaskArguments, 0, &ledTaskHandle);
|
||||
|
||||
Logger_construct(mainLog, &uart3->device, 2, 512);
|
||||
Logger_construct(mainLog, &uart3->device, 1, 512);
|
||||
|
||||
NHD0420_construct(&nhd0420, &spiDisplay->device);
|
||||
|
||||
Display_construct(display, &nhd0420.displayDevice, 0, 256, 10, 1000, 5000);
|
||||
Display_construct(display, &nhd0420.displayDevice, 2, 256, 10, 1000, 10000);
|
||||
|
||||
Display_clearScreen(display);
|
||||
|
||||
@@ -207,6 +213,24 @@ static void initTask(void* parameters)
|
||||
Version_getInstance()->patch);
|
||||
Display_write(display, buffer, strlen(buffer), 3, 4);
|
||||
|
||||
MAX5715_construct(&max5715, &spiDAC->device);
|
||||
|
||||
MAX5715_writeREF_ON_2V5(&max5715);
|
||||
|
||||
MAX5715_writePOWER_NORMAL(&max5715, MAX5715_SEL_DACA | MAX5715_SEL_DACB | MAX5715_SEL_DACC);
|
||||
|
||||
MAX5715_writeCONFIG_LATCH_OFF(&max5715, MAX5715_SEL_DACA | MAX5715_SEL_DACB | MAX5715_SEL_DACC);
|
||||
|
||||
MAX5715Channel_construct(&dac->dac[0], dac, 0);
|
||||
MAX5715Channel_construct(&dac->dac[1], dac, 1);
|
||||
MAX5715Channel_construct(&dac->dac[2], dac, 2);
|
||||
|
||||
xTaskCreate(printSystemInfoTask, (const char* const)"SysInfoTask", 512, NULL, 0, &sysTaskHandle);
|
||||
|
||||
// Let start screen stay for 5 seconds
|
||||
vTaskDelay(INIT_START_SCREEN_DELAY);
|
||||
|
||||
|
||||
hwTestItems.display = &nhd0420.displayDevice;
|
||||
hwTestItems.internalADC = adc1;
|
||||
hwTestItems.externalDAC = &max5715;
|
||||
@@ -223,33 +247,11 @@ static void initTask(void* parameters)
|
||||
hwTestItems.teslaLock = teslaLock;
|
||||
hwTestItems.pcba = pcba;
|
||||
// EEPROM TO BE DONE
|
||||
// HwValidationMenu_construct(hwValidation, &uart1->device, &hwTestItems, 1, 1024);
|
||||
HwValidationMenu_construct(hwValidation, &uart1->device, &hwTestItems, 1, 512);
|
||||
|
||||
|
||||
MAX5715_construct(&max5715, &spiDAC->device);
|
||||
|
||||
MAX5715_writeREF_ON_2V5(&max5715);
|
||||
|
||||
MAX5715_writePOWER_NORMAL(&max5715, MAX5715_SEL_DACA | MAX5715_SEL_DACB | MAX5715_SEL_DACC);
|
||||
|
||||
MAX5715_writeCONFIG_LATCH_OFF(&max5715, MAX5715_SEL_DACA | MAX5715_SEL_DACB | MAX5715_SEL_DACC);
|
||||
|
||||
MAX5715Channel_construct(&max5715.dac[0], &max5715, 0);
|
||||
MAX5715Channel_construct(&max5715.dac[1], &max5715, 1);
|
||||
MAX5715Channel_construct(&max5715.dac[2], &max5715, 2);
|
||||
|
||||
MAX5715Channel_setValue(&max5715.dac[0], 0x200);
|
||||
MAX5715Channel_setValue(&max5715.dac[1], 0x800);
|
||||
MAX5715Channel_setValue(&max5715.dac[2], 0xD00);
|
||||
|
||||
|
||||
repairProcess_construct(rp, 3, 1024);
|
||||
|
||||
xTaskCreate(printSystemInfoTask, (const char* const)"SysInfoTask", 512, NULL, 1, &sysTaskHandle);
|
||||
|
||||
// Let start screen stay for 5 seconds
|
||||
vTaskDelay(INIT_START_SCREEN_DELAY);
|
||||
repairMenu_construct(rm, display, 2, 512);
|
||||
// Delete this init task
|
||||
|
||||
vTaskDelete(NULL);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user