Stability Fix

Clearing flags instead of ITStatus seems to improve stability in EXTI interrupts

Added ASSERT functionality for STM std periphery library

Also busy updating the HW validation menu


git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@411 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-12-22 14:09:08 +00:00
parent 15d02bfa4f
commit 5e6e8a8ff5
17 changed files with 367 additions and 264 deletions

View File

@@ -5,7 +5,7 @@
<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 class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1872025056620872132" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1529458100419697121" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross 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>
@@ -16,7 +16,7 @@
<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 class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1872025056620872132" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1529458100419697121" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross 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>

View File

@@ -120,4 +120,6 @@ extern void Led_off(Led led);
*/
extern bool Led_getStatus(Led led);
#endif /* INC_LEDS_H_ */

View File

@@ -191,3 +191,4 @@ extern bool Led_getStatus(Led led)
}
return returnValue;
}

View File

@@ -83,7 +83,21 @@ extern struct Storm700* const storm700;
// internal FLASH
extern struct InternalFlash* const iFlash;
// Export of GPIOs
extern struct Gpio* const ledBicolourGreen;
extern struct Gpio* const ledBicolourRed;
extern struct Gpio* const solenoid;
extern struct Gpio* const buzzer;
extern struct Gpio* const mcp0Relay;
extern struct Gpio* const mcp1Relay;
extern struct Gpio* const mcp2Relay;
extern struct Gpio* const cat0Relay;
extern struct Gpio* const cat1Relay;
extern struct Gpio* const cat2Relay;
extern struct Gpio* const teslaRelay;
extern struct Gpio* const hv0Present;
extern struct Gpio* const hv1Present;
extern struct Gpio* const hv2Present;
extern struct Interlock* const interlock;

View File

@@ -127,66 +127,66 @@ ErrorStatus Keypad_construct(struct Keypad* self, size_t numberOfRows, size_t nu
LOGGER_INFO(mainLog, "Keypad task started");
self->initialized = true;
// // TUBE REPAIR
// struct KeypadQueueItem rxQueueItem;
// rxQueueItem.rowCoordinate = 0;
// rxQueueItem.columnCoordinate = 0;
// rxQueueItem.keyEvent = PRESSED;
// // Put event in queue
// xQueueSend(self->rxQueue, &rxQueueItem, 0);
// rxQueueItem.rowCoordinate = 0;
// rxQueueItem.columnCoordinate = 0;
// rxQueueItem.keyEvent = RELEASED;
// // Put event in queue
// xQueueSend(self->rxQueue, &rxQueueItem, 0);
//
// // SELECT CATHODE
// rxQueueItem.rowCoordinate = 0;
// rxQueueItem.columnCoordinate = 0;
// rxQueueItem.keyEvent = PRESSED;
// // Put event in queue
// xQueueSend(self->rxQueue, &rxQueueItem, 0);
// rxQueueItem.rowCoordinate = 0;
// rxQueueItem.columnCoordinate = 0;
// rxQueueItem.keyEvent = RELEASED;
// // Put event in queue
// xQueueSend(self->rxQueue, &rxQueueItem, 0);
//
// // SELECT PRESET
// rxQueueItem.rowCoordinate = 0;
// rxQueueItem.columnCoordinate = 0;
// rxQueueItem.keyEvent = PRESSED;
// // Put event in queue
// xQueueSend(self->rxQueue, &rxQueueItem, 0);
// rxQueueItem.rowCoordinate = 0;
// rxQueueItem.columnCoordinate = 0;
// rxQueueItem.keyEvent = RELEASED;
// // Put event in queue
// xQueueSend(self->rxQueue, &rxQueueItem, 0);
//
// // SELECT PRESET 7
// rxQueueItem.rowCoordinate = 2;
// rxQueueItem.columnCoordinate = 0;
// rxQueueItem.keyEvent = PRESSED;
// // Put event in queue
// xQueueSend(self->rxQueue, &rxQueueItem, 0);
// rxQueueItem.rowCoordinate = 2;
// rxQueueItem.columnCoordinate = 0;
// rxQueueItem.keyEvent = RELEASED;
// // Put event in queue
// xQueueSend(self->rxQueue, &rxQueueItem, 0);
//
// // START
// rxQueueItem.rowCoordinate = 0;
// rxQueueItem.columnCoordinate = 1;
// rxQueueItem.keyEvent = PRESSED;
// // Put event in queue
// xQueueSend(self->rxQueue, &rxQueueItem, 0);
// rxQueueItem.rowCoordinate = 0;
// rxQueueItem.columnCoordinate = 1;
// rxQueueItem.keyEvent = RELEASED;
// // Put event in queue
// xQueueSend(self->rxQueue, &rxQueueItem, 0);
// TUBE REPAIR
struct KeypadQueueItem rxQueueItem;
rxQueueItem.rowCoordinate = 0;
rxQueueItem.columnCoordinate = 0;
rxQueueItem.keyEvent = PRESSED;
// Put event in queue
xQueueSend(self->rxQueue, &rxQueueItem, 0);
rxQueueItem.rowCoordinate = 0;
rxQueueItem.columnCoordinate = 0;
rxQueueItem.keyEvent = RELEASED;
// Put event in queue
xQueueSend(self->rxQueue, &rxQueueItem, 0);
// SELECT CATHODE
rxQueueItem.rowCoordinate = 0;
rxQueueItem.columnCoordinate = 0;
rxQueueItem.keyEvent = PRESSED;
// Put event in queue
xQueueSend(self->rxQueue, &rxQueueItem, 0);
rxQueueItem.rowCoordinate = 0;
rxQueueItem.columnCoordinate = 0;
rxQueueItem.keyEvent = RELEASED;
// Put event in queue
xQueueSend(self->rxQueue, &rxQueueItem, 0);
// SELECT PRESET
rxQueueItem.rowCoordinate = 0;
rxQueueItem.columnCoordinate = 0;
rxQueueItem.keyEvent = PRESSED;
// Put event in queue
xQueueSend(self->rxQueue, &rxQueueItem, 0);
rxQueueItem.rowCoordinate = 0;
rxQueueItem.columnCoordinate = 0;
rxQueueItem.keyEvent = RELEASED;
// Put event in queue
xQueueSend(self->rxQueue, &rxQueueItem, 0);
// SELECT PRESET 7
rxQueueItem.rowCoordinate = 2;
rxQueueItem.columnCoordinate = 0;
rxQueueItem.keyEvent = PRESSED;
// Put event in queue
xQueueSend(self->rxQueue, &rxQueueItem, 0);
rxQueueItem.rowCoordinate = 2;
rxQueueItem.columnCoordinate = 0;
rxQueueItem.keyEvent = RELEASED;
// Put event in queue
xQueueSend(self->rxQueue, &rxQueueItem, 0);
// START
rxQueueItem.rowCoordinate = 0;
rxQueueItem.columnCoordinate = 1;
rxQueueItem.keyEvent = PRESSED;
// Put event in queue
xQueueSend(self->rxQueue, &rxQueueItem, 0);
rxQueueItem.rowCoordinate = 0;
rxQueueItem.columnCoordinate = 1;
rxQueueItem.keyEvent = RELEASED;
// Put event in queue
xQueueSend(self->rxQueue, &rxQueueItem, 0);
}
else

View File

@@ -267,7 +267,7 @@ ErrorStatus Uart_read (struct Uart* self, char* buffer, size_t length, size_t* a
void USART1_IRQHandler(void)
{
static signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
//! Transmission register empty interrupt
@@ -316,7 +316,7 @@ void USART1_IRQHandler(void)
void USART3_IRQHandler(void)
{
static signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
//! Transmission register empty interrupt

View File

@@ -54,6 +54,7 @@
extern "C" {
#endif
/** @addtogroup Library_configuration_section
* @{
*/
@@ -102,7 +103,7 @@
In this case, these drivers will not be included and the application code will
be based on direct access to peripherals registers
*/
/*#define USE_STDPERIPH_DRIVER*/
#define USE_STDPERIPH_DRIVER
#endif
/**

View File

@@ -210,6 +210,7 @@ void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource)
}
}
/**
* @}
*/

View File

@@ -17,7 +17,7 @@ OBJDIR = $(OBJDIR_PREFIX)_$(BUILD)_$(LANG)
CROSS_COMPILE = arm-none-eabi-
CC = $(CROSS_COMPILE)gcc
CCFLAGS = -c -O2 -g -fno-common -mcpu=cortex-m3 -mthumb -DUSE_FULL_ASSERT $(INCLUDE_DIRS) -I. -Wall -Werror -D"assert_param(expr)=((void)0)"
CCFLAGS = -c -O2 -g -fno-common -mcpu=cortex-m3 -mthumb -DUSE_FULL_ASSERT $(INCLUDE_DIRS) -I. -Wall -Werror
AR = $(CROSS_COMPILE)ar
ARFLAGS = rs

View File

@@ -11,54 +11,19 @@
<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"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.814944186" name="Debug" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating binary and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O binary &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.bin&quot;; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;">
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.814944186" name="Debug" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug.814944186" postannouncebuildStep="Generating binary and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O binary &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.bin&quot;; arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;">
<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.814944186." name="/" resourcePath="">
<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.876257254" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug">
<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.876257254" name="Ac6 STM32 MCU GCC">
<option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1898459751" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32F107VCTx" valueType="string"/>
<option id="fr.ac6.managedbuild.option.gnu.cross.board.167195522" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" value="mrts" valueType="string"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.571534251" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/hsb-mrts}/Debug" id="fr.ac6.managedbuild.builder.gnu.cross.1108034516" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross"/>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1021623787" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
<option id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.1652525186" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false"/>
<option id="gnu.c.compiler.option.debugging.level.539814773" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.1508262411" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/inc&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/HAL/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/Platform/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FreeRTOS/Source/portable/GCC/ARM_CM3}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FreeRTOS/Source/include}&quot;"/>
</option>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1485033197" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="STM32F107VCTx"/>
<listOptionValue builtIn="false" value="STM32F1"/>
<listOptionValue builtIn="false" value="STM32"/>
<listOptionValue builtIn="false" value="DEBUG"/>
</option>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1974727002" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1389700752" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/>
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.411048122" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.158718496" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false"/>
<option id="gnu.cpp.compiler.option.debugging.level.1444074598" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.1527324290" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.518644862" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.75142976" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker"/>
<tool id="fr.ac6.managedbuild.tool.gnu.archiver.1257660188" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver"/>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.1212982284" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler">
<option id="gnu.both.asm.option.include.paths.323645567" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/inc&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1496493679" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.1477651575" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>
</tool>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.571534251" isAbstract="false" osList="all"/>
<builder buildPath="${workspace_loc:/hsb-mrts}/Debug" id="fr.ac6.managedbuild.builder.gnu.cross.1108034516" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder"/>
</toolChain>
</folderInfo>
<sourceEntries>
@@ -69,6 +34,7 @@
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="ilg.gnumcueclipse.managedbuild.packs"/>
</cconfiguration>
<cconfiguration id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1149120676">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1149120676" moduleId="org.eclipse.cdt.core.settings" name="Release">
@@ -80,49 +46,19 @@
<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"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1149120676" name="Release" parent="fr.ac6.managedbuild.config.gnu.cross.exe.release" postannouncebuildStep="Generating binary and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O binary &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.bin&quot;; arm-none-eabi-size -B &quot;${BuildArtifactFileName}&quot;">
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1149120676" name="Release" parent="fr.ac6.managedbuild.config.gnu.cross.exe.release.1149120676" postannouncebuildStep="Generating binary and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O binary &quot;${BuildArtifactFileBaseName}.elf&quot; &quot;${BuildArtifactFileBaseName}.bin&quot;; arm-none-eabi-size -B &quot;${BuildArtifactFileName}&quot;">
<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1149120676." name="/" resourcePath="">
<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release.1805220061" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release">
<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.release.1805220061" name="Ac6 STM32 MCU GCC">
<option id="fr.ac6.managedbuild.option.gnu.cross.mcu.152000996" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu" value="STM32F107VCTx" valueType="string"/>
<option id="fr.ac6.managedbuild.option.gnu.cross.board.476057367" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board" value="mrts" valueType="string"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.1373212422" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/hsb-mrts}/Release" id="fr.ac6.managedbuild.builder.gnu.cross.1219464533" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross"/>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1306912163" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
<option id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.368235649" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.most" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.127552553" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.1231243907" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/inc&quot;"/>
</option>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1303089013" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="STM32F107VCTx"/>
<listOptionValue builtIn="false" value="STM32F1"/>
<listOptionValue builtIn="false" value="STM32"/>
</option>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.538267174" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1828201949" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/>
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.196866618" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.1453894553" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.710978606" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.224864187" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1386357615" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.121711263" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker"/>
<tool id="fr.ac6.managedbuild.tool.gnu.archiver.1919128253" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver"/>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.1446085907" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler">
<option id="gnu.both.asm.option.include.paths.665920197" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/inc&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1956811726" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.229104566" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>
</tool>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.1373212422" isAbstract="false" osList="all"/>
<builder buildPath="${workspace_loc:/hsb-mrts}/Release" id="fr.ac6.managedbuild.builder.gnu.cross.1219464533" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder"/>
</toolChain>
</folderInfo>
<sourceEntries>
@@ -136,7 +72,7 @@
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="hsb-mrts.fr.ac6.managedbuild.target.gnu.cross.exe.489922077" name="Executable" projectType="fr.ac6.managedbuild.target.gnu.cross.exe"/>
<project id="hsb-mrts.fr.ac6.managedbuild.target.gnu.cross.exe.489922077" name="Executable"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
@@ -160,11 +96,20 @@
<buildTargets>
<target name="all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cproject>

View File

@@ -6,10 +6,6 @@
<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.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-43896984865580189" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU 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="fr.ac6.managedbuild.config.gnu.cross.exe.release.1149120676" name="Release">
@@ -18,10 +14,6 @@
<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.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-43896984865580189" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU 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

@@ -60,7 +60,6 @@ struct HwValidationMenuItems
struct DisplayDevice* display; // DisplayDevice to talk to
struct Adc* internalADC; // Internal ADC with channel array
struct MAX5715* externalDAC; // External DAC with channel array
struct Gpio* power6v5Enable;
struct Gpio* interlockNO;
struct Gpio* interlockNC;
struct Gpio* TeslaSecurity;
@@ -71,9 +70,14 @@ struct HwValidationMenuItems
struct Gpio* cat0Relay;
struct Gpio* cat1Relay;
struct Gpio* cat2Relay;
struct Gpio* hv0;
struct Gpio* hv1;
struct Gpio* hv2;
struct Gpio* bicolourGreen;
struct Gpio* bicolourRed;
struct Pcba* pcba;
struct Keypad *keypad;
// struct Buzzer* buzzer;
struct Buzzer* buzzer;
};
struct HwValidationMenu

View File

@@ -30,6 +30,7 @@
#include <stdint.h>
#include <stdio.h>
#include "Leds.h"
#include "Logger.h"
#include "platform.h"
@@ -103,6 +104,7 @@ caddr_t _sbrk(int incr)
// Stack overflow hook
void vApplicationStackOverflowHook(xTaskHandle xTask, signed portCHAR* pcTaskName)
{
// Led_on(LED_ONBOARD_ORANGE);
LOGGER_ERROR(mainLog, "STACK OVERFLOW IN TASK %s", pcTaskName);
}
@@ -115,5 +117,6 @@ void vApplicationMallocFailedHook(void)
// Assert for StdPeriph library
void assert_failed(uint8_t* file, uint32_t line)
{
// Logger_log((char*)file, "", line, LOGTYPE_ERROR, "assert failed");
LOGGER_ERROR(mainLog, "assert failed! File %s - line %d", file, (int)line);
}

View File

@@ -28,12 +28,14 @@
#include "hwValidationMenu.h"
#include "DisplayDevice.h"
#include "gpio.h"
#include "internalADC.h"
#include "PCBA.h"
#include "MAX5715.h"
#include "nhd0420.h"
#include "Buzzer.h"
#include "Logger.h"
#include "keypadMatrix.h"
@@ -55,7 +57,7 @@
typedef enum
{
CONSOLE_MAIN_MENU,
CONSOLE_TEST_POWER,
CONSOLE_TEST_LED,
CONSOLE_TEST_DISPLAY,
CONSOLE_TEST_ADC,
CONSOLE_TEST_DAC,
@@ -63,6 +65,7 @@ typedef enum
CONSOLE_TEST_TESLA_SECURITY,
CONSOLE_TEST_SOLENOID,
CONSOLE_TEST_RELAY,
CONSOLE_TEST_BUZZER,
CONSOLE_TEST_GENERIC,
CONSOLE_IDLE
}Menu_States_t;
@@ -70,7 +73,7 @@ typedef enum
typedef enum
{
DISPLAY_MENU_MAIN,
DISPLAY_MENU_POWER,
DISPLAY_MENU_LED,
DISPLAY_MENU_DISPLAY,
DISPLAY_MENU_ADC,
DISPLAY_MENU_DAC,
@@ -78,6 +81,7 @@ typedef enum
DISPLAY_MENU_TESLA_SECURITY,
DISPLAY_MENU_SOLENOID,
DISPLAY_MENU_RELAY,
DISPLAY_MENU_BUZZER,
DISPLAY_MENU_GENERIC
}Display_States_t;
@@ -109,7 +113,7 @@ static const char conInfMainMenu[] =
ANSI_TERMINAL_HOME
" MAIN MENU \r\n"
" Select one of the options: \r\n"
" [%c] Test Power \r\n"
" [%c] Test LEDs \r\n"
" [%c] Test Display \r\n"
" [%c] Test ADCs \r\n"
" [%c] Test DACs \r\n"
@@ -117,12 +121,13 @@ static const char conInfMainMenu[] =
" [%c] Test Tesla security \r\n"
" [%c] Test Solenoids \r\n"
" [%c] Test relays \r\n"
" [%c] Test buzzer \r\n"
" [%c] Test Keypad/PCB variant \r\n"
" \r\n";
enum
{
MENU_MAIN_POWER,
MENU_MAIN_LED,
MENU_MAIN_DISPLAY,
MENU_MAIN_ADC,
MENU_MAIN_DAC,
@@ -130,29 +135,30 @@ enum
MENU_MAIN_TESLA_SECURITY,
MENU_MAIN_SOLENOID,
MENU_MAIN_RELAY,
MENU_MAIN_BUZZER,
MENU_MAIN_GENERIC,
MENU_MAIN_LAST
};
static const char conTestPower[] =
static const char conTestLed[] =
ANSI_TERMINAL_RESET
ANSI_TERMINAL_HOME
" TEST POWER \r\n"
" TEST LEDs \r\n"
" \r\n"
" Control the 6V5 power supply \r\n"
" Control the BiColour LED \r\n"
" \r\n"
" [%c] Power on 6V5 \r\n"
" [%c] Power off 6V5 \r\n"
" [%c] GREEN TOGGLE \r\n"
" [%c] RED TOGGLE \r\n"
" [%c] Back \r\n"
" \r\n";
enum
{
MENU_TEST_POWER_ON,
MENU_TEST_POWER_OFF,
MENU_TEST_POWER_BACK,
MENU_TEST_POWER_LAST
MENU_TEST_LED_GREEN,
MENU_TEST_LED_RED,
MENU_TEST_LED_BACK,
MENU_TEST_LED_LAST
};
@@ -326,6 +332,23 @@ enum
MENU_TEST_RELAYS_LAST
};
static const char conTestBuzzer[] =
ANSI_TERMINAL_RESET
ANSI_TERMINAL_HOME
" TEST Buzzer \r\n"
" \r\n"
" Test the Buzzer \r\n"
" \r\n"
" [%c] Toggle buzzer \r\n"
" [%c] Back \r\n"
" \r\n";
enum
{
MENU_TEST_BUZZER_TOGGLE,
MENU_TEST_BUZZER_BACK,
MENU_TEST_BUZZER_LAST
};
static const char conTestGeneric[] =
ANSI_TERMINAL_RESET
@@ -507,11 +530,11 @@ static void hwValidationMenuSM(struct HwValidationMenu* self, Button_Pressed_t b
else if( button == BUTTON_ENTER )
{
// Go to selected menu
if( self->menuItemSelected == MENU_MAIN_POWER )
if( self->menuItemSelected == MENU_MAIN_LED )
{
self->menuItemSelected = 0;
menuState = CONSOLE_TEST_POWER;
hwValidationMenuDisplay(self, DISPLAY_MENU_POWER );
menuState = CONSOLE_TEST_LED;
hwValidationMenuDisplay(self, DISPLAY_MENU_LED );
}
else if( self->menuItemSelected == MENU_MAIN_DISPLAY)
{
@@ -555,6 +578,12 @@ static void hwValidationMenuSM(struct HwValidationMenu* self, Button_Pressed_t b
menuState = CONSOLE_TEST_RELAY;
hwValidationMenuDisplay(self, DISPLAY_MENU_RELAY );
}
else if( self->menuItemSelected == MENU_MAIN_BUZZER )
{
self->menuItemSelected = 0;
menuState = CONSOLE_TEST_BUZZER;
hwValidationMenuDisplay(self, DISPLAY_MENU_BUZZER );
}
else if( self->menuItemSelected == MENU_MAIN_GENERIC )
{
self->menuItemSelected = 0;
@@ -566,55 +595,73 @@ static void hwValidationMenuSM(struct HwValidationMenu* self, Button_Pressed_t b
break;
case CONSOLE_TEST_POWER:
case CONSOLE_TEST_LED:
if( button == BUTTON_UP )
{
if( self->menuItemSelected == 0 )
self->menuItemSelected = (MENU_TEST_POWER_LAST - 1);
self->menuItemSelected = (MENU_TEST_LED_LAST - 1);
else
self->menuItemSelected--;
hwValidationMenuDisplay(self, DISPLAY_MENU_POWER );
hwValidationMenuDisplay(self, DISPLAY_MENU_LED );
}
else if( button == BUTTON_DOWN )
{
if( self->menuItemSelected == (MENU_TEST_POWER_LAST - 1) )
if( self->menuItemSelected == (MENU_TEST_LED_LAST - 1) )
self->menuItemSelected = 0;
else
self->menuItemSelected++;
hwValidationMenuDisplay(self, DISPLAY_MENU_POWER );
hwValidationMenuDisplay(self, DISPLAY_MENU_LED );
}
else if( button == BUTTON_ENTER )
{
if( self->menuItemSelected == MENU_TEST_POWER_ON )
if( self->menuItemSelected == MENU_TEST_LED_GREEN )
{
// Turn on 6V5 power ( enable active low )
if(GPIO_setValue(self->testItems->power6v5Enable, false) == SUCCESS)
bool value = false;
if( GPIO_getValue(self->testItems->bicolourGreen, &value) == SUCCESS)
{
outputBufferLength = sprintf(self->outputBuffer, "Power: Off\r\n");
// Invert current value
value = !value;
if( GPIO_setValue(self->testItems->bicolourGreen, value) == SUCCESS)
{
outputBufferLength = sprintf(self->outputBuffer, "GREEN LED: Toggled\r\n");
}
else
{
outputBufferLength = sprintf(self->outputBuffer, "GREEN LED: Failed to set value\r\n");
}
}
else
else
{
outputBufferLength = sprintf(self->outputBuffer, "Power: Failure\r\n");
outputBufferLength = sprintf(self->outputBuffer, "GREEN LED: Failed to get value\r\n");
}
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
}
else if (self->menuItemSelected == MENU_TEST_POWER_OFF )
else if (self->menuItemSelected == MENU_TEST_LED_RED )
{
//Turn on 6V5 power ( enable active low )
if( GPIO_setValue(self->testItems->power6v5Enable, true) == SUCCESS)
bool value = false;
if( GPIO_getValue(self->testItems->bicolourRed, &value) == SUCCESS)
{
outputBufferLength = sprintf(self->outputBuffer, "Power: Off\r\n");
// Invert current value
value = !value;
if( GPIO_setValue(self->testItems->bicolourRed, value) == SUCCESS)
{
outputBufferLength = sprintf(self->outputBuffer, "RED LED: Toggled\r\n");
}
else
{
outputBufferLength = sprintf(self->outputBuffer, "RED LED: Failed to set value\r\n");
}
}
else
else
{
outputBufferLength = sprintf(self->outputBuffer, "Power: Failure\r\n");
outputBufferLength = sprintf(self->outputBuffer, "RED LED: Failed to get value\r\n");
}
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
}
else if (self->menuItemSelected == MENU_TEST_POWER_BACK )
else if (self->menuItemSelected == MENU_TEST_LED_BACK )
{
// Back to main menu
self->menuItemSelected = 0;
@@ -928,14 +975,14 @@ static void hwValidationMenuSM(struct HwValidationMenu* self, Button_Pressed_t b
case CONSOLE_TEST_TESLA_SECURITY:
if( button == BUTTON_UP )
{
if( self->menuItemSelected == 0 )
self->menuItemSelected = (MENU_TEST_TESLA_LAST- 1);
else
self->menuItemSelected--;
{
if( self->menuItemSelected == 0 )
self->menuItemSelected = (MENU_TEST_TESLA_LAST- 1);
else
self->menuItemSelected--;
hwValidationMenuDisplay(self, DISPLAY_MENU_TESLA_SECURITY );
}
hwValidationMenuDisplay(self, DISPLAY_MENU_TESLA_SECURITY );
}
else if( button == BUTTON_DOWN )
{
if( self->menuItemSelected == (MENU_TEST_TESLA_LAST - 1) )
@@ -1119,6 +1166,59 @@ static void hwValidationMenuSM(struct HwValidationMenu* self, Button_Pressed_t b
}
break;
case CONSOLE_TEST_BUZZER:
if( button == BUTTON_UP )
{
if( self->menuItemSelected == 0 )
self->menuItemSelected = (MENU_TEST_BUZZER_LAST- 1);
else
self->menuItemSelected--;
hwValidationMenuDisplay(self, DISPLAY_MENU_BUZZER );
}
else if( button == BUTTON_DOWN )
{
if( self->menuItemSelected == (MENU_TEST_BUZZER_LAST - 1) )
self->menuItemSelected = 0;
else
self->menuItemSelected++;
hwValidationMenuDisplay(self, DISPLAY_MENU_BUZZER );
}
else if( button == BUTTON_ENTER )
{
bool value = false;
if( self->menuItemSelected == MENU_TEST_BUZZER_TOGGLE)
{
if( GPIO_getValue(self->testItems->buzzer->gpio, &value) == SUCCESS)
{
// Invert current value
value = !value;
if( GPIO_setValue(self->testItems->buzzer->gpio, value) == SUCCESS)
{
outputBufferLength = sprintf(self->outputBuffer, "Buzzer: Toggled\r\n");
}
else
{
outputBufferLength = sprintf(self->outputBuffer, "buzzer: Failed to set value\r\n");
}
}
else
{
outputBufferLength = sprintf(self->outputBuffer, "buzzer: Failed to get value\r\n");
}
IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
}
else if (self->menuItemSelected == MENU_TEST_BUZZER_BACK )
{
// Back to main menu
self->menuItemSelected = 0;
menuState = CONSOLE_MAIN_MENU;
hwValidationMenuDisplay(self, DISPLAY_MENU_MAIN );
}
}
break;
// case CONSOLE_TEST_PCB_VARIANT:
// if(self->testItems->pcba)
@@ -1129,13 +1229,6 @@ static void hwValidationMenuSM(struct HwValidationMenu* self, Button_Pressed_t b
// IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
// break;
// case CONSOLE_TEST_EEPROM:
// // No sub test
// //TODO: implement test
// outputBufferLength = sprintf(self->outputBuffer, "[TODO] EEPROM TEST\r\n");
// IODevice_write(self->ioDevice, self->outputBuffer, outputBufferLength);
// break;
case CONSOLE_TEST_GENERIC:
@@ -1259,7 +1352,7 @@ static void hwValidationMenuDisplay(struct HwValidationMenu* self, Display_State
// Fill buffer with menu items
char menuBuffer[ sizeof( conInfMainMenu ) ];
menu_length = sprintf( menuBuffer, conInfMainMenu,
menuItems[MENU_MAIN_POWER],
menuItems[MENU_MAIN_LED],
menuItems[MENU_MAIN_DISPLAY],
menuItems[MENU_MAIN_ADC],
menuItems[MENU_MAIN_DAC],
@@ -1267,6 +1360,7 @@ static void hwValidationMenuDisplay(struct HwValidationMenu* self, Display_State
menuItems[MENU_MAIN_TESLA_SECURITY],
menuItems[MENU_MAIN_SOLENOID],
menuItems[MENU_MAIN_RELAY],
menuItems[MENU_MAIN_BUZZER],
menuItems[MENU_MAIN_GENERIC]
);
@@ -1274,23 +1368,23 @@ static void hwValidationMenuDisplay(struct HwValidationMenu* self, Display_State
IODevice_write(self->ioDevice, menuBuffer, menu_length);
break;
case DISPLAY_MENU_POWER:
case DISPLAY_MENU_LED:
// Put an asterisk (*) at the selected item in the menu
for( menuIndex = 0; menuIndex < MENU_TEST_POWER_LAST; menuIndex++ )
for( menuIndex = 0; menuIndex < MENU_TEST_LED_LAST; menuIndex++ )
{
MENU_DRAW_SELECTED(menuIndex);
}
// Fill buffer with menu items
char powerMenuBuffer[ sizeof( conTestPower ) ];
menu_length = sprintf( powerMenuBuffer, conTestPower,
menuItems[MENU_TEST_POWER_ON],
menuItems[MENU_TEST_POWER_OFF],
menuItems[MENU_TEST_POWER_BACK]
char ledMenuBuffer[ sizeof( conTestLed ) ];
menu_length = sprintf( ledMenuBuffer, conTestLed,
menuItems[MENU_TEST_LED_GREEN],
menuItems[MENU_TEST_LED_RED],
menuItems[MENU_TEST_LED_BACK]
);
// Write message to debout interface
IODevice_write(self->ioDevice, powerMenuBuffer, menu_length);
IODevice_write(self->ioDevice, ledMenuBuffer, menu_length);
break;
@@ -1445,6 +1539,25 @@ static void hwValidationMenuDisplay(struct HwValidationMenu* self, Display_State
IODevice_write(self->ioDevice, relayMenuBuffer, menu_length);
break;
case DISPLAY_MENU_BUZZER:
// Put an asterisk (*) at the selected item in the menu
for( menuIndex = 0; menuIndex < MENU_TEST_BUZZER_LAST; menuIndex++ )
{
MENU_DRAW_SELECTED(menuIndex);
}
// Fill buffer with menu items
char buzzerMenuBuffer[ sizeof( conTestBuzzer ) ];
menu_length = sprintf( buzzerMenuBuffer, conTestBuzzer,
menuItems[MENU_TEST_BUZZER_TOGGLE],
menuItems[MENU_TEST_BUZZER_BACK]
);
// Write message to debout interface
IODevice_write(self->ioDevice, buzzerMenuBuffer, menu_length);
break;
// case DISPLAY_MENU_KEYPAD:
// break;

View File

@@ -173,35 +173,36 @@ static ErrorStatus systeminfoCommandHandler(void)
LOGGER_INFO(mainLog, text);
// vTaskList(taskList);
// IODevice_write((struct IODevice*)uart1, taskList, 600);
// IODevice_write((struct IODevice*)uart1, taskList, strlen(taskList));
// IODevice_write((struct IODevice*)uart1, "\n\r\n\r", 5);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(initTaskHandle);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(errorTaskHandle);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(warningTaskHandle);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(interlock->taskHandle);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(mainLog->taskHandle);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(keypad->taskHandle);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(mainBuzzer->taskHandle);
vTaskDelay(100);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(mainDisplay->taskHandle);
#ifdef ENABLE_HW_VALIDATION
vTaskDelay(50);
OS_logTaskInfo(hwValidation->taskHandle);
#endif
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(sysTaskHandle);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(ledTaskHandle);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(mainMenu->menuCore->taskHandle);
vTaskDelay(100);
vTaskDelay(50);
OS_logTaskInfo(rp->taskHandle);
@@ -286,17 +287,22 @@ static void initTask(void* parameters)
hwTestItems.display = &nhd0420->displayDevice;
hwTestItems.internalADC = adc1;
hwTestItems.externalDAC = max5715;
// hwTestItems.power6v5Enable = Power6V5Supply_getGPIO();
hwTestItems.interlockNO = interlock->NO.io;
hwTestItems.interlockNC = interlock->NC.io;
hwTestItems.TeslaSecurity = TeslaGunSafety_getGpio();
hwTestItems.solenoid = CoverSolenoid_getGpio();
hwTestItems.mcp0Relay = CathodeMCP_getInstance()->mcp0;
hwTestItems.mcp1Relay = CathodeMCP_getInstance()->mcp1;
hwTestItems.mcp2Relay = CathodeMCP_getInstance()->mcp2;
hwTestItems.cat0Relay = CathodeMCP_getInstance()->cat0;
hwTestItems.cat1Relay = CathodeMCP_getInstance()->cat1;
hwTestItems.cat2Relay = CathodeMCP_getInstance()->cat2;
hwTestItems.TeslaSecurity = teslaRelay;
hwTestItems.solenoid = solenoid;
hwTestItems.mcp0Relay = mcp0Relay;
hwTestItems.mcp1Relay = mcp1Relay;
hwTestItems.mcp2Relay = mcp2Relay;
hwTestItems.cat0Relay = cat0Relay;
hwTestItems.cat1Relay = cat1Relay;
hwTestItems.cat2Relay = cat2Relay;
hwTestItems.buzzer = mainBuzzer;
hwTestItems.bicolourRed = ledBicolourRed;
hwTestItems.bicolourGreen = ledBicolourGreen;
hwTestItems.hv0 = hv0Present;
hwTestItems.hv1 = hv1Present;
hwTestItems.hv2 = hv2Present;
hwTestItems.pcba = PCBA_getInstance();
hwTestItems.keypad = keypad;
// EEPROM TO BE DONE
@@ -340,7 +346,7 @@ static void ledBlinkTask (void* parameters)
int frequency = arguments->frequency;
while (1)
{
Led_on(arguments->led);
// Led_on(arguments->led);
if (PCBA_getInstance()->pcba == PCBA_CathodeMCP)
{
@@ -354,7 +360,7 @@ static void ledBlinkTask (void* parameters)
}
vTaskDelay(configTICK_RATE_HZ / (frequency * 2));
Led_off(arguments->led);
// Led_off(arguments->led);
indicator[0] = ' ';
// Display_write(mainDisplay, indicator, 1, 20);
vTaskDelay(configTICK_RATE_HZ / (frequency * 2));

View File

@@ -43,6 +43,7 @@
#include "repairMenu.h"
#include "repairProcess.h"
#include "Leds.h"
#include "Logger.h"
#include "platform.h"
#include "rtc.h"
@@ -132,6 +133,10 @@ void IRQ_setKeypadEXTI(struct Keypad* self, FunctionalState command)
// }
void HardFault_Handler(void)
{
while (1);
}
/** ----------------------------------------------------------------------------
* @brief Function: SPI1_IRQHandler
@@ -145,7 +150,7 @@ void IRQ_setKeypadEXTI(struct Keypad* self, FunctionalState command)
*/
void SPI1_IRQHandler (void)
{
static signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
//! Transmission register empty interrupt
if(SPI_I2S_GetITStatus(SPI1, SPI_I2S_IT_TXE) != RESET)
@@ -195,7 +200,7 @@ void SPI1_IRQHandler (void)
*/
void SPI3_IRQHandler (void)
{
static signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
//! Transmission register empty interrupt
if(SPI_I2S_GetITStatus(SPI3, SPI_I2S_IT_TXE) != RESET)
@@ -235,10 +240,13 @@ void SPI3_IRQHandler (void)
void EXTI0_IRQHandler(void)
{
static signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
xSemaphoreGiveFromISR(interlock->semaphore, &higherPriorityTaskWoken);
EXTI_ClearITPendingBit(EXTI_Line0);
if(EXTI_GetITStatus(EXTI_Line0) != RESET)
{
xSemaphoreGiveFromISR(interlock->semaphore, &higherPriorityTaskWoken);
EXTI_ClearITPendingBit(EXTI_Line0);
}
portEND_SWITCHING_ISR(higherPriorityTaskWoken);
}
@@ -246,10 +254,13 @@ void EXTI0_IRQHandler(void)
void EXTI1_IRQHandler(void)
{
static signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
xSemaphoreGiveFromISR(interlock->semaphore, &higherPriorityTaskWoken);
EXTI_ClearITPendingBit(EXTI_Line1);
if(EXTI_GetITStatus(EXTI_Line1) != RESET)
{
xSemaphoreGiveFromISR(interlock->semaphore, &higherPriorityTaskWoken);
EXTI_ClearITPendingBit(EXTI_Line1);
}
portEND_SWITCHING_ISR(higherPriorityTaskWoken);
}
@@ -257,46 +268,55 @@ void EXTI1_IRQHandler(void)
void EXTI4_IRQHandler(void)
{
static signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
IRQ_setKeypadEXTI(keypad, DISABLE);
xSemaphoreGiveFromISR(keypad->scanSemaphore, &higherPriorityTaskWoken);
EXTI_ClearITPendingBit(EXTI_Line4);
if(EXTI_GetFlagStatus(EXTI_Line4) != RESET)
{
EXTI_ClearFlag(EXTI_Line4);
IRQ_setKeypadEXTI(keypad, DISABLE);
xSemaphoreGiveFromISR(keypad->scanSemaphore, &higherPriorityTaskWoken);
}
portEND_SWITCHING_ISR(higherPriorityTaskWoken);
}
void EXTI9_5_IRQHandler (void)
{
static signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
signed portBASE_TYPE higherPriorityTaskWoken = pdFALSE;
if (EXTI_GetITStatus(EXTI_Line5) != RESET)
Led_on(LED_ONBOARD_GREEN);
if (EXTI_GetFlagStatus(EXTI_Line5) != RESET)
{
EXTI_ClearFlag(EXTI_Line5);
IRQ_setKeypadEXTI(keypad, DISABLE);
xSemaphoreGiveFromISR(keypad->scanSemaphore, &higherPriorityTaskWoken);
EXTI_ClearITPendingBit(EXTI_Line5);
}
else if (EXTI_GetITStatus(EXTI_Line6) != RESET)
else if (EXTI_GetFlagStatus(EXTI_Line6) != RESET)
{
EXTI_ClearFlag(EXTI_Line6);
IRQ_setKeypadEXTI(keypad, DISABLE);
xSemaphoreGiveFromISR(keypad->scanSemaphore, &higherPriorityTaskWoken);
EXTI_ClearITPendingBit(EXTI_Line6);
}
else if (EXTI_GetITStatus(EXTI_Line7) != RESET)
else if (EXTI_GetFlagStatus(EXTI_Line7) != RESET)
{
EXTI_ClearFlag(EXTI_Line7);
IRQ_setKeypadEXTI(keypad, DISABLE);
xSemaphoreGiveFromISR(keypad->scanSemaphore, &higherPriorityTaskWoken);
EXTI_ClearITPendingBit(EXTI_Line7);
}
else if (EXTI_GetITStatus(EXTI_Line8) != RESET)
else if (EXTI_GetFlagStatus(EXTI_Line8) != RESET)
{
EXTI_ClearITPendingBit(EXTI_Line8);
EXTI_ClearFlag(EXTI_Line8);
}
else if (EXTI_GetITStatus(EXTI_Line9) != RESET)
else if (EXTI_GetFlagStatus(EXTI_Line9) != RESET)
{
EXTI_ClearITPendingBit(EXTI_Line9);
EXTI_ClearFlag(EXTI_Line9);
}
Led_off(LED_ONBOARD_GREEN);
portEND_SWITCHING_ISR(higherPriorityTaskWoken);
}