Replaced verification of voltageFree rows with HighVoltageDetection module
Added LED module git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@338 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
#define MAINDISP_REFRESH_FEED_MS (1000)
|
||||
#define MAINDISP_REFRESH_PERIOD (5000)
|
||||
|
||||
#define MAINDISP_DEFAULT_BRIGHTNESS (8) // Set to MAX to avoid background light issue
|
||||
#define MAINDISP_DEFAULT_BRIGHTNESS (5) // Set to MAX to avoid background light issue
|
||||
#define MAINDISP_DEFAULT_CONTRAST (40)
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions
|
||||
|
||||
@@ -51,7 +51,8 @@ struct ErrorQueueItem
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static struct Observable observable;
|
||||
static TaskHandle_t errorTaskHandle;
|
||||
///TODO TEMPORARY NOT STATIC
|
||||
TaskHandle_t errorTaskHandle;
|
||||
static QueueHandle_t errorQueue;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@@ -132,10 +132,29 @@ static ErrorStatus PIN_verifyInsertedPins(struct PIN* self)
|
||||
{
|
||||
ErrorStatus returnValue = SUCCESS;
|
||||
|
||||
if(strncmp(self->pinchangeFirstInsert, self->pinchangeSecondInsert, PIN_NUMBER_OF_DIGITS) != 0)
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
// Inserted PINs are not equal
|
||||
returnValue = ERROR;
|
||||
if (strlen(self->pinchangeFirstInsert) != PIN_NUMBER_OF_DIGITS)
|
||||
{
|
||||
returnValue = ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
if (strlen(self->pinchangeSecondInsert) != PIN_NUMBER_OF_DIGITS)
|
||||
{
|
||||
returnValue = ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
if(strncmp(self->pinchangeFirstInsert, self->pinchangeSecondInsert, PIN_NUMBER_OF_DIGITS) != 0)
|
||||
{
|
||||
// Inserted PINs are not equal
|
||||
returnValue = ERROR;
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include "platform.h"
|
||||
#include "CoverSolenoid.h"
|
||||
#include "HighVoltageDetection.h"
|
||||
#include "Interlock.h"
|
||||
#include "Logger.h"
|
||||
#include "PCBA.h"
|
||||
@@ -225,27 +226,12 @@ ErrorStatus hsb_disableSafety(void)
|
||||
DAConverter_setOutputVoltage(dacRow3, 0);
|
||||
|
||||
|
||||
if (PCBA_getInstance()->pcba != PCBA_Tesla)
|
||||
while (HighVoltageDetection_isVoltagePresent())
|
||||
{
|
||||
// Verify that all High Voltage Supplies are shut off and voltages are below security value
|
||||
while ((abs(adcR1Value) >= HSB_SECURITY_VOLTAGE_THRESHOLD) || (abs(adcR2Value) >= HSB_SECURITY_VOLTAGE_THRESHOLD) || (abs(adcR3Value) >= HSB_SECURITY_VOLTAGE_THRESHOLD))
|
||||
{
|
||||
adcR1Value = ADConverter_getInputVoltage(adcRow1);
|
||||
adcR2Value = ADConverter_getInputVoltage(adcRow2);
|
||||
adcR3Value = ADConverter_getInputVoltage(adcRow3);
|
||||
vTaskDelay(100);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Verify that all High Voltage Supplies are shut off and voltages are below security value
|
||||
while (abs(adcR2Value) >= HSB_SECURITY_VOLTAGE_THRESHOLD)
|
||||
{
|
||||
adcR2Value = ADConverter_getInputVoltage(adcRow2);
|
||||
vTaskDelay(100);
|
||||
}
|
||||
vTaskDelay(100);
|
||||
}
|
||||
|
||||
|
||||
Display_clearLine(mainDisplay, 3);
|
||||
Display_clearLine(mainDisplay, 4);
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "Error.h"
|
||||
#include "hsb-mrts.h"
|
||||
#include "hwValidationMenu.h"
|
||||
#include "repairMenu.h"
|
||||
#include "repairMenus.h"
|
||||
#include "Warning.h"
|
||||
|
||||
@@ -163,6 +164,19 @@ static ErrorStatus systeminfoCommandHandler(void)
|
||||
snprintf(text, sizeof(text), "Free heap memory: %d bytes", (int)freeMemory);
|
||||
LOGGER_INFO(mainLog, text);
|
||||
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(initTaskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(ledTaskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(sysTaskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(mainMenu->menuCore->taskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(mainDisplay->taskHandle);
|
||||
vTaskDelay(10);
|
||||
OS_logTaskInfo(errorTaskHandle);
|
||||
|
||||
|
||||
|
||||
return errorStatus;
|
||||
@@ -193,12 +207,6 @@ static void initTask(void* parameters)
|
||||
initPlatform();
|
||||
}
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
// Construct the LEDs
|
||||
Led_construct();
|
||||
}
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
// Construct the displays
|
||||
|
||||
Reference in New Issue
Block a user