Most parts of the menu structure are functional.
Error handler added Screens for warning, pause, FINISH etc yet to be added git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@255 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "hsb-mrts.h"
|
||||
|
||||
#include "Error.h"
|
||||
#include "repairMenus.h"
|
||||
#include "repairMenu.h"
|
||||
|
||||
@@ -61,7 +62,7 @@ struct RepairMenu* const mainMenu = &_mainMenu;
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static ErrorStatus repairMenus_mainMenuObserverFromISR(const void* const data);
|
||||
static ErrorStatus repairMenu_errorReceive(const void* const data);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function definitions
|
||||
@@ -79,7 +80,7 @@ ErrorStatus repairMenus_construct(void)
|
||||
|
||||
if (returnValue == SUCCESS)
|
||||
{
|
||||
returnValue = Observable_addObserver(RTC_getObservable(rtc), repairMenus_mainMenuObserverFromISR);
|
||||
returnValue = Observable_addObserver(Error_getObservable(), repairMenu_errorReceive);
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
@@ -88,13 +89,30 @@ ErrorStatus repairMenus_construct(void)
|
||||
|
||||
void repairMenus_destruct(void)
|
||||
{
|
||||
Observable_deleteObserver(RTC_getObservable(rtc), repairMenus_mainMenuObserverFromISR);
|
||||
Observable_deleteObserver(Error_getObservable(), repairMenu_errorReceive);
|
||||
repairMenu_destruct(mainMenu);
|
||||
}
|
||||
|
||||
|
||||
static ErrorStatus repairMenus_mainMenuObserverFromISR(const void* const data)
|
||||
static ErrorStatus repairMenu_errorReceive(const void* const data)
|
||||
{
|
||||
repairMenu_feedSecondsCounterFromISR(mainMenu);
|
||||
return SUCCESS;
|
||||
T_ErrorCode errorCode = (T_ErrorCode)data;
|
||||
// Only respond to the errors necessary
|
||||
if (errorCode == INTERLOCK_COMMON_FAIL)
|
||||
{
|
||||
repairMenu_interlockFailed(mainMenu, COMMON_INTERLOCK);
|
||||
}
|
||||
else if (errorCode == INTERLOCK_TESLA_FAIL)
|
||||
{
|
||||
repairMenu_interlockFailed(mainMenu, TESLA_INTERLOCK);
|
||||
}
|
||||
else if (errorCode == POWERENABLE_FAIL)
|
||||
{
|
||||
|
||||
}
|
||||
else if (errorCode == REPAIR_FAIL)
|
||||
{
|
||||
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user