Fixed problem with errors not showing up when repair process finished

Started working on issue to release tesla gun only when target voltage has been reached

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@430 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2018-02-05 15:58:06 +00:00
parent f02bd2002b
commit d5a10b7c2e
11 changed files with 242 additions and 17 deletions

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.633115638">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.633115638" moduleId="org.eclipse.cdt.core.settings" name="Build (GNU)">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools,org.eclipse.cdt.build.core.buildType=org.eclipse.linuxtools.cdt.autotools.core.buildType.default" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.633115638" name="Build (GNU)" parent="org.eclipse.linuxtools.cdt.autotools.core.configuration.build">
<folderInfo id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.633115638." name="/" resourcePath="">
<toolChain id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.422860816" name="GNU Autotools Toolchain" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolChain">
<targetPlatform id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform.1029111098" isAbstract="false" name="GNU Autotools Target Platform" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform"/>
<builder id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder.929797064" managedBuildOn="true" name="Autotools Makefile Generator.Build (GNU)" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder"/>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure.820974331" name="configure" superClass="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure"/>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.2066400180" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"/>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.1088589192" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc"/>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp.466766961" name="GCC C++ Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp"/>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.debug.744190146">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.debug.744190146" moduleId="org.eclipse.cdt.core.settings" name="Debug (GNU)">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools,org.eclipse.cdt.build.core.buildType=org.eclipse.linuxtools.cdt.autotools.core.buildType.debug" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.debug.744190146" name="Debug (GNU)" parent="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.debug">
<folderInfo id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.debug.744190146." name="/" resourcePath="">
<toolChain id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.debug.641334063" name="GNU Autotools Toolchain" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolChain.debug">
<targetPlatform id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform.debug.1441068326" isAbstract="false" name="GNU Autotools Target Platform" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform.debug"/>
<builder id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder.debug.128822693" managedBuildOn="true" name="Autotools Makefile Generator.Debug (GNU)" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder.debug"/>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure.debug.1494382716" name="configure" superClass="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure.debug">
<option defaultValue="CFLAGS=-g -O0" id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.user.1814169703" superClass="org.eclipse.linuxtools.cdt.autotools.core.option.configure.user" valueType="string"/>
</tool>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.debug.198565686" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.debug"/>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.debug.1483593252" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.debug"/>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp.debug.359672027" name="GCC C++ Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp.debug"/>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="0 - Code.org.eclipse.linuxtools.cdt.autotools.core.projectType.1448297344" name="GNU Autotools" projectType="org.eclipse.linuxtools.cdt.autotools.core.projectType"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
</cproject>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>0 - Code</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.autotools.core.genmakebuilderV2</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.autotools.core.autotoolsNatureV2</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.633115638" name="Build (GNU)">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.autotools.core.LibtoolGCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-109920668884" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
<configuration id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.debug.744190146" name="Debug (GNU)">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.autotools.core.LibtoolGCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-109920668884" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
</project>

View File

@@ -85,7 +85,7 @@ extern void TeslaGunSafety_destruct(void);
/** ---------------------------------------------------------------------------- /** ----------------------------------------------------------------------------
* TeslaGunSafety_unlock * TeslaGunSafety_release
* Opens the TeslaGunSafety * Opens the TeslaGunSafety
* *
* @param self * @param self
@@ -98,6 +98,18 @@ extern void TeslaGunSafety_destruct(void);
extern ErrorStatus TeslaGunSafety_release(void); extern ErrorStatus TeslaGunSafety_release(void);
/** ----------------------------------------------------------------------------
* TeslaGunSafety_isRreleased
* Opens the TeslaGunSafety
*
* @return bool TRUE if released
*
* @todo
* -----------------------------------------------------------------------------
*/
extern bool TeslaGunSafety_release(void);
/** ---------------------------------------------------------------------------- /** ----------------------------------------------------------------------------
* TeslaGunSafety_block * TeslaGunSafety_block
* Blocks the TeslaGunSafety * Blocks the TeslaGunSafety

View File

@@ -99,6 +99,16 @@ ErrorStatus TeslaGunSafety_release(void)
} }
bool TeslaGunSafety_isReleased(void)
{
bool returnValue;
GPIO_getValue(self.gpio, &returnValue);
return returnValue;
}
ErrorStatus TeslaGunSafety_block(void) ErrorStatus TeslaGunSafety_block(void)
{ {
ErrorStatus returnValue = SUCCESS; ErrorStatus returnValue = SUCCESS;

View File

@@ -99,6 +99,7 @@ struct MenuPage
struct MenuCore struct MenuCore
{ {
void* parent;
struct MenuPage menuArray[RM_NUMBER_OF_MENUS]; struct MenuPage menuArray[RM_NUMBER_OF_MENUS];
struct Display* display; struct Display* display;
struct KeyboardDevice* keyboardDevice; struct KeyboardDevice* keyboardDevice;

View File

@@ -231,11 +231,12 @@ static const char MenuText_PAUSE[MENUTEXT_NUMBER_OF_LANGUAGES][5][MENUTEXT_POPUP
} }
}; };
static const char MenuText_FINISH[MENUTEXT_NUMBER_OF_LANGUAGES][2][MENUTEXT_POPUP_MESSAGE_LENGTH] = static const char MenuText_FINISH[MENUTEXT_NUMBER_OF_LANGUAGES][3][MENUTEXT_POPUP_MESSAGE_LENGTH] =
{ {
// MAX 20 CHARACTERS // MAX 20 CHARACTERS
{ {
"REPAIR FINISHED", "REPAIR FINISHED",
"Error in row",
"Hit ENT to continue", "Hit ENT to continue",
}, },
{ {

View File

@@ -42,6 +42,7 @@
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
#define REPAIR_PRESETS_NUMBER_OF_PRESETS (9) #define REPAIR_PRESETS_NUMBER_OF_PRESETS (9)
#define REPAIR_PRESETS_DEFAULT_PRESET (1)
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Type definitions. // Type definitions.

View File

@@ -68,10 +68,12 @@ struct RepairMenu
struct MemoryDevice* memoryDevice; struct MemoryDevice* memoryDevice;
struct CachedStorage presetStorage; struct CachedStorage presetStorage;
SemaphoreHandle_t repairScreenUpdateSemaphore; SemaphoreHandle_t repairScreenUpdateSemaphore;
const struct RepairPreset* repairPreset;
struct RepairProcessParameters rpParameters;
Observer observer; Observer observer;
struct MenuCore* menuCore; struct MenuCore* menuCore;
struct RepairProcess* repairProcess;
struct RepairProcessParameters rpParameters;
const struct RepairPreset* repairPreset;
bool processResult[REPAIRPROCESS_NUMBER_OF_ROWS];
}; };
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------

View File

@@ -132,15 +132,7 @@ ErrorStatus hsb_enableSafetyWithError(void)
// returnValue = ERROR; // returnValue = ERROR;
// } // }
// } // }
//
// if (returnValue == SUCCESS)
// {
// // In case of a TESLA repair, release the teslaGunSafety
// if (PCBA_getInstance()->pcba == PCBA_Tesla)
// {
// TeslaGunSafety_release();
// }
// }
if (returnValue == SUCCESS) if (returnValue == SUCCESS)
{ {

View File

@@ -180,6 +180,7 @@ ErrorStatus repairMenu_construct(struct RepairMenu* self, struct MenuCore* menuC
if (menuCore->initialized) if (menuCore->initialized)
{ {
self->menuCore = menuCore; self->menuCore = menuCore;
self->menuCore->parent = self;
} }
else else
{ {
@@ -210,12 +211,12 @@ ErrorStatus repairMenu_construct(struct RepairMenu* self, struct MenuCore* menuC
else if (PCBA_getInstance()->pcba == PCBA_Anode) else if (PCBA_getInstance()->pcba == PCBA_Anode)
{ {
RepairPresets_loadPresets(REPAIR_PRESETS_ANODE); RepairPresets_loadPresets(REPAIR_PRESETS_ANODE);
self->repairPreset = RepairPresets_getPreset(1); self->repairPreset = RepairPresets_getPreset(REPAIR_PRESETS_DEFAULT_PRESET);
} }
else if (PCBA_getInstance()->pcba == PCBA_Tesla) else if (PCBA_getInstance()->pcba == PCBA_Tesla)
{ {
RepairPresets_loadPresets(REPAIR_PRESETS_TESLA); RepairPresets_loadPresets(REPAIR_PRESETS_TESLA);
self->repairPreset = RepairPresets_getPreset(1); self->repairPreset = RepairPresets_getPreset(REPAIR_PRESETS_DEFAULT_PRESET);
} }
MenuCore_changeState(self->menuCore, RM_MAINMENU); MenuCore_changeState(self->menuCore, RM_MAINMENU);
@@ -416,8 +417,30 @@ static void repairMenu_printPause(struct MenuCore* self)
static void repairMenu_printFinish(struct MenuCore* self) static void repairMenu_printFinish(struct MenuCore* self)
{ {
Display_writeCentered(self->display, MenuText_FINISH[languageIndex][0], 2); char buffer[self->display->displayDevice->parameters.numberOfColumns];
Display_writeCentered(self->display, MenuText_FINISH[languageIndex][1], 4); buffer[0] = '\0';
int loopCounter;
bool printErrorMessage = false;
Display_writeCentered(self->display, MenuText_FINISH[languageIndex][0], 1);
// Check if any error has appeared
for (loopCounter = ((PCBA_getInstance()->pcba == PCBA_Tesla) ? 1 : 0); loopCounter <= ((PCBA_getInstance()->pcba == PCBA_Tesla) ? 1 : 2); loopCounter++)
{
if (((struct RepairMenu*)self->parent)->processResult[loopCounter])
{
printErrorMessage = true;
snprintf(buffer, sizeof(buffer), "%s %d ", buffer, loopCounter + 1); // +1 for human-readable row numbers
}
}
// Error string only needs single printing
if (printErrorMessage)
{
Display_writeCentered(self->display, MenuText_FINISH[languageIndex][1], 2);
Display_writeCentered(self->display, buffer, 3);
}
Display_writeCentered(self->display, MenuText_FINISH[languageIndex][2], 4);
} }
@@ -1052,6 +1075,7 @@ static void repairMenu_teslagunBlock(struct MenuCore* self)
static void repairMenu_startRepairProcess(struct MenuCore* self) static void repairMenu_startRepairProcess(struct MenuCore* self)
{ {
ErrorStatus returnValue = SUCCESS; ErrorStatus returnValue = SUCCESS;
int loopCounter;
struct RepairMenu* repairMenu = repairMenus_getMainRepairMenu(); struct RepairMenu* repairMenu = repairMenus_getMainRepairMenu();
@@ -1071,13 +1095,30 @@ static void repairMenu_startRepairProcess(struct MenuCore* self)
// If all is OK, start the repair process // If all is OK, start the repair process
if (returnValue == SUCCESS) if (returnValue == SUCCESS)
{ {
// Check if a preset has been selected - otherwise go to default preset
if (repairMenu->repairPreset == NULL)
{
repairMenu->repairPreset = RepairPresets_getPreset(REPAIR_PRESETS_DEFAULT_PRESET);
}
returnValue = repairProcesses_startMainRepairProcess(repairMenu->repairPreset, &repairMenu->rpParameters); returnValue = repairProcesses_startMainRepairProcess(repairMenu->repairPreset, &repairMenu->rpParameters);
if (returnValue != SUCCESS) if (returnValue != SUCCESS)
{ {
Error_postError(REPAIR_FAIL); Error_postError(REPAIR_FAIL);
} }
} }
if (returnValue == SUCCESS)
{
((struct RepairMenu*)self->parent)->repairProcess = repairProcesses_getMainRepairProcess();
// Reset the test results (just in case)
for (loopCounter = ((PCBA_getInstance()->pcba == PCBA_Tesla) ? 1 : 0); loopCounter <= ((PCBA_getInstance()->pcba == PCBA_Tesla) ? 1 : 2); loopCounter++)
{
((struct RepairMenu*)self->parent)->processResult[loopCounter] = false;
}
}
if (returnValue == SUCCESS) if (returnValue == SUCCESS)
{ {
returnValue = repairProcesses_mainRepairProcessAddObserver(repairMenu->observer); returnValue = repairProcesses_mainRepairProcessAddObserver(repairMenu->observer);
@@ -1136,6 +1177,7 @@ static void repairMenu_gotoLastState(struct MenuCore* self)
void repairMenu_menuStateHandle(struct MenuCore* self) void repairMenu_menuStateHandle(struct MenuCore* self)
{ {
int loopCounter;
// Stop the buzzer from recovered error or warning // Stop the buzzer from recovered error or warning
if (self->lastMenuState == RM_ERROR_STATE) if (self->lastMenuState == RM_ERROR_STATE)
@@ -1188,6 +1230,26 @@ void repairMenu_menuStateHandle(struct MenuCore* self)
uint32_t remainingTime = repairProcess_getRemainingRepairTime(repairProcesses_getMainRepairProcess()); uint32_t remainingTime = repairProcess_getRemainingRepairTime(repairProcesses_getMainRepairProcess());
Led_on(LED_BICOLOR_GREEN); Led_on(LED_BICOLOR_GREEN);
// For the TESLA REPAIR, the tesla gun is only allowed to be released when the VOLTAGE HOLD state has been reached
// and the voltage is within the limits
if (PCBA_getInstance()->pcba == PCBA_Tesla)
{
if (!TeslaGunSafety_isReleased())
{
if (repairProcesses_getMainRepairProcess()->signalProfileGenerator.currentState == SPG_VOLTAGE_HOLD)
{
if (!repairProcesses_getMainRepairProcess()->row[1].errorData.rowHasError)
{
TeslaGunSafety_release();
LOGGER_INFO(mainLog, "Tesla Gun is released");
}
}
}
}
if (remainingTime > (2 * REPAIRMENU_POPUPSCREEN_TIME_MS / 1000)) if (remainingTime > (2 * REPAIRMENU_POPUPSCREEN_TIME_MS / 1000))
{ {
self->popUpCounter = remainingTime - (2 * REPAIRMENU_POPUPSCREEN_TIME_MS / 1000); self->popUpCounter = remainingTime - (2 * REPAIRMENU_POPUPSCREEN_TIME_MS / 1000);
@@ -1222,6 +1284,14 @@ void repairMenu_menuStateHandle(struct MenuCore* self)
} }
else if (self->menuState == RM_FINISH_CONTROL) else if (self->menuState == RM_FINISH_CONTROL)
{ {
LOGGER_DEBUG(mainLog, "Result %d %d %d", ((struct RepairMenu*)self->parent)->processResult[0], ((struct RepairMenu*)self->parent)->processResult[1], ((struct RepairMenu*)self->parent)->processResult[2]);
// Receive the final repair row status
for (loopCounter = ((PCBA_getInstance()->pcba == PCBA_Tesla) ? 1 : 0); loopCounter <= ((PCBA_getInstance()->pcba == PCBA_Tesla) ? 1 : 2); loopCounter++)
{
((struct RepairMenu*)self->parent)->processResult[loopCounter] = ((struct RepairMenu*)self->parent)->repairProcess->row[loopCounter].errorData.rowHasError;
}
repairMenu_stopRepairProcess(self); repairMenu_stopRepairProcess(self);
PowerLossDetector_clearBusyFlag(); PowerLossDetector_clearBusyFlag();
MenuCore_changeState(self, RM_FINISH); MenuCore_changeState(self, RM_FINISH);