Skip to content
Snippets Groups Projects
Commit 4b729d48 authored by Carlo Alessandro Nicolau's avatar Carlo Alessandro Nicolau
Browse files

[yet to be tested] added static vars

parent 37448f9b
No related branches found
No related tags found
No related merge requests found
......@@ -207,6 +207,9 @@ if __name__ == '__main__':
print "CONVERTED VALUES:"
field_idx = 0
for field in command.response_payload:
s = ' {} = {:0.3} {}'.format(field.name, convertedvals[field_idx][0], convertedvals[field_idx][1])
print s
try:
s = ' {} = {:0.3} {}'.format(field.name, convertedvals[field_idx][0], convertedvals[field_idx][1])
print s
except:
pass
field_idx += 1
......@@ -4,14 +4,14 @@
<string>TMR0</string>
<string>class com.microchip.mcc.mcu8.modules.tmr0_v1.TMR0</string>
</entry>
<entry>
<string>System Module</string>
<string>class com.microchip.mcc.mcu8.systemManager.SystemManager</string>
</entry>
<entry>
<string>ADC</string>
<string>class com.microchip.mcc.mcu8.modules.adc.ADC</string>
</entry>
<entry>
<string>System Module</string>
<string>class com.microchip.mcc.mcu8.systemManager.SystemManager</string>
</entry>
<entry>
<string>FVR</string>
<string>class com.microchip.mcc.mcu8.modules.fvr.FVR</string>
......@@ -32,14 +32,14 @@
<string>CCP5</string>
<string>class com.microchip.mcc.mcu8.modules.ccp_v3.CCP</string>
</entry>
<entry>
<string>EUSART1</string>
<string>class com.microchip.mcc.mcu8.modules.eusart.EUSART</string>
</entry>
<entry>
<string>RESET</string>
<string>class com.microchip.mcc.mcu8.systemManager.reset.RESET</string>
</entry>
<entry>
<string>EUSART1</string>
<string>class com.microchip.mcc.mcu8.modules.eusart.EUSART</string>
</entry>
<entry>
<string>Interrupt Module</string>
<string>class com.microchip.mcc.mcu8.interruptManager.InterruptManager</string>
......@@ -407,7 +407,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="EUSART1" registerAlias="TXI" settingAlias="order"/>
<value>2</value>
<value>6</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="IOCB" settingAlias="IOCB6" alias="enabled"/>
......@@ -505,14 +505,14 @@
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="ADC" registerAlias="ADCON0" settingAlias="CHS" alias="AN4"/>
<value>4</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="FVR" registerAlias="FVRCON" settingAlias="CDAFVR" alias="1x"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="ADC" registerAlias="ADCON0" settingAlias="CHS" alias="AN3"/>
<value>3</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="FVR" registerAlias="FVRCON" settingAlias="CDAFVR" alias="1x"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="ADC" registerAlias="ADCON0" settingAlias="CHS" alias="AN6"/>
<value>6</value>
......@@ -1141,14 +1141,14 @@
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="WPUB" settingAlias="WPUB0" alias="set"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="EUSART1" registerAlias="RCI" settingAlias="enable"/>
<value>enabled</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="ADC" registerAlias="ADCON2" settingAlias="ADCS" alias="FOSC/4"/>
<value>4</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="EUSART1" registerAlias="RCI" settingAlias="enable"/>
<value>enabled</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="ADC" registerAlias="ADCON2" settingAlias="ADCS" alias="FOSC/2"/>
<value>0</value>
......@@ -1329,14 +1329,14 @@
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="System Module" registerAlias="CONFIG1H" settingAlias="PRICLKEN" alias="OFF"/>
<value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="CCP5" name="pwmCCPRDisplayValue"/>
<value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="TMR0" registerAlias="TMRI" settingAlias="order"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="CCP5" name="pwmCCPRDisplayValue"/>
<value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="TMR0" name="minPeriod"/>
<value>0.000004</value>
......@@ -1423,7 +1423,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Interrupt Module" name="SelectedInterruptIndexHigh"/>
<value>3</value>
<value>5</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="ADC" registerAlias="ADCON1" settingAlias="ADNREF" alias="VSS"/>
......@@ -1706,11 +1706,11 @@
<value>2</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="CCP5" registerAlias="CCPCON" settingAlias="CCPM" alias="Rising edge"/>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="TMR0" registerAlias="T0CON" settingAlias="PS" alias="1:64"/>
<value>5</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="TMR0" registerAlias="T0CON" settingAlias="PS" alias="1:64"/>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="CCP5" registerAlias="CCPCON" settingAlias="CCPM" alias="Rising edge"/>
<value>5</value>
</entry>
<entry>
......@@ -1949,14 +1949,14 @@
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="Pin Module" registerAlias="LATC"/>
<value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="CCP5" name="CCPPinName"/>
<value>enabled</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="EUSART1" registerAlias="TXSTA" settingAlias="SENDB"/>
<value>sync_break_complete</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="CCP5" name="CCPPinName"/>
<value>enabled</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="System Module" registerAlias="CONFIG5H"/>
<value>192</value>
......@@ -2293,14 +2293,14 @@
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="INTERNAL OSCILLATOR" name="CustomFOSC"/>
<value>Internal oscillator block</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="CCP5" registerAlias="CCPI" settingAlias="order"/>
<value>4</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="EUSART1" registerAlias="RCSTA" settingAlias="CREN"/>
<value>enabled</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="CCP5" registerAlias="CCPI" settingAlias="order"/>
<value>2</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="TRISD" settingAlias="TRISD4" alias="input"/>
<value>1</value>
......@@ -2949,14 +2949,14 @@
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="INTERNAL OSCILLATOR" registerAlias="OSCCON" settingAlias="IRCF" alias="250KHz_HFINTOSC/64"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="FVR" registerAlias="FVRCON" settingAlias="FVRRDY" alias="enabled"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="ADC" registerAlias="ADCON2" settingAlias="ACQT" alias="8"/>
<value>4</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="FVR" registerAlias="FVRCON" settingAlias="FVRRDY" alias="enabled"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="anselUserSetRC2"/>
<value>disabled</value>
......@@ -3317,14 +3317,14 @@
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="CCP5" registerAlias="CCPTMRS" settingAlias="CTSEL" alias="PWM5timer2"/>
<value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="EUSART1" registerAlias="RCSTA" settingAlias="RX9" alias="8-bit"/>
<value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="ADC" name="enableInterrupt"/>
<value>disabled</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="EUSART1" registerAlias="RCSTA" settingAlias="RX9" alias="8-bit"/>
<value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="System Module" registerAlias="CONFIG1H" settingAlias="FOSC" alias="ECHPIO6"/>
<value>5</value>
......@@ -3757,14 +3757,14 @@
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="ANSELA" settingAlias="ANSA5" alias="digital"/>
<value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="EUSART1" registerAlias="TXSTA" settingAlias="SENDB" alias="send_sync_break_next"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="ADC" registerAlias="ADI" settingAlias="enable"/>
<value>disabled</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="EUSART1" registerAlias="TXSTA" settingAlias="SENDB" alias="send_sync_break_next"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="System Module" registerAlias="CONFIG3H" settingAlias="CCP3MX" alias="PORTB5"/>
<value>4</value>
......@@ -4181,14 +4181,14 @@
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="RB4"/>
<value>input</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="EUSART1" name="templateNameValue"/>
<value>eusart_interrupt</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="ADC" name="AN22"/>
<value>disabled</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="EUSART1" name="templateNameValue"/>
<value>eusart_interrupt</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="RB7"/>
<value>input</value>
......@@ -4339,7 +4339,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="ADC" registerAlias="ADI" settingAlias="order"/>
<value>6</value>
<value>4</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="ADC" name="AN16"/>
......@@ -4517,14 +4517,14 @@
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="TMR0" registerAlias="TMRI" settingAlias="flag"/>
<value>disabled</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="EUSART1" registerAlias="RCSTA" settingAlias="CREN" alias="disabled"/>
<value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="ADC" registerAlias="ADCON2" settingAlias="ACQT"/>
<value>20</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="EUSART1" registerAlias="RCSTA" settingAlias="CREN" alias="disabled"/>
<value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="Pin Module" registerAlias="ANSELE"/>
<value>7</value>
......@@ -4593,14 +4593,14 @@
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="System Module" registerAlias="CONFIG7L" settingAlias="EBTR3" alias="OFF"/>
<value>8</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="CCP5" registerAlias="CCPTMRS" settingAlias="CTSEL" alias="CCP5timer3"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="TMR2" name="timerPeriodMax"/>
<value>0.000256</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="CCP5" registerAlias="CCPTMRS" settingAlias="CTSEL" alias="CCP5timer3"/>
<value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="INTERNAL OSCILLATOR" name="FOSCClockValue"/>
<value>64000000</value>
......@@ -4779,7 +4779,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="RBI" settingAlias="order"/>
<value>5</value>
<value>3</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="RD3"/>
......@@ -4855,7 +4855,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="EUSART1" registerAlias="RCI" settingAlias="order"/>
<value>3</value>
<value>5</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="customNameUserSet RB0"/>
......@@ -5071,22 +5071,22 @@
<file>mcc_generated_files/fvr.c</file>
<hash>24982a75b542982c020400313ec6e311aa40dbf519f028eccdff1e1b7d489568</hash>
</entry>
<entry>
<file>mcc_generated_files/tmr0.c</file>
<hash>b148174c2c60c29a5406e0754fe9b5623d22f9debe4303ef97ce0e1f4b951033</hash>
</entry>
<entry>
<file>mcc_generated_files/pin_manager.h</file>
<hash>63afe0661072367ed7f02048395b49f9b0d2f760e2f246b878b15047d394ba59</hash>
</entry>
<entry>
<file>main.c</file>
<hash>87bbe9578cf7703cdbfd9af1caeeb4c11efd4c03fde69c03bbc26710a79b1ca5</hash>
<file>mcc_generated_files/tmr0.c</file>
<hash>b148174c2c60c29a5406e0754fe9b5623d22f9debe4303ef97ce0e1f4b951033</hash>
</entry>
<entry>
<file>mcc_generated_files/eusart1.h</file>
<hash>adaab835ea05ef3b79b26fd176fb2a8e6d4fbba509dd821f8e01b946f3839d4d</hash>
</entry>
<entry>
<file>main.c</file>
<hash>87bbe9578cf7703cdbfd9af1caeeb4c11efd4c03fde69c03bbc26710a79b1ca5</hash>
</entry>
<entry>
<file>mcc_generated_files/tmr2.h</file>
<hash>e450ed94162721f5ac2c245378419f8c38f0b9dcc95a4642bb4879b6d61b3312</hash>
......@@ -5115,30 +5115,30 @@
<file>mcc_generated_files/adc.c</file>
<hash>198e19c5c6435d1bed824bbdc3f045d3d1a7c313d869a9c8828aaf19e0d08344</hash>
</entry>
<entry>
<file>mcc_generated_files/mcc.h</file>
<hash>3e9418c8d9f41381e4e09b6614cdc61728125d27e42c7a2af63db4e7512a5ad3</hash>
</entry>
<entry>
<file>mcc_generated_files/eusart1.c</file>
<hash>9d090647b9883d331d538804d24b4e47c448761c2681b445c93b49a7368b1915</hash>
</entry>
<entry>
<file>mcc_generated_files/mcc.h</file>
<hash>3e9418c8d9f41381e4e09b6614cdc61728125d27e42c7a2af63db4e7512a5ad3</hash>
</entry>
<entry>
<file>mcc_generated_files/device_config.c</file>
<hash>1a03314d224a4ddfcbee78607808e14e673be22bdfa19b5cdc5906eae36baa31</hash>
</entry>
<entry>
<file>mcc_generated_files/interrupt_manager.c</file>
<hash>e8b9dffb0d70449ea54caa68ec15f385c88175e6485055d92eac8801a039c407</hash>
</entry>
<entry>
<file>mcc_generated_files/mcc.c</file>
<hash>184aea097c89a85dca3321db8276433451ea0ff31e35cd95d8a970560cb8caaa</hash>
<hash>01c1b1dc75c0bcf5074aa2632fba709f0c75b11e30a1b3149ba8e21ac505a8f3</hash>
</entry>
<entry>
<file>mcc_generated_files/fvr.h</file>
<hash>9370db448e1f6eadbd24bcd74ccdc505f1bd34051ea9f1be49baf6fdb0669b45</hash>
</entry>
<entry>
<file>mcc_generated_files/mcc.c</file>
<hash>184aea097c89a85dca3321db8276433451ea0ff31e35cd95d8a970560cb8caaa</hash>
</entry>
<entry>
<file>mcc_generated_files/pin_manager.c</file>
<hash>730784579d6ce17441dd92dd77b86d2c3080580dae5f1dc41a577ba171709bfb</hash>
......
......@@ -26,8 +26,9 @@ err_t command_SENSOR_MAXVALUE_RESET(void) {
// End of auto-generated section
// USER CODE HERE
// TODO CHECK command_SENSOR_MAXVALUE_RESET
for(uint8_t variable_number = enum_variable_number_t_min; variable_number <= enum_variable_number_t_max; variable_number++) {
// TODO CHECK command_SENSOR_MAXVALUE_RESET
for(uint8_t variable_number = enum_variable_number_t_min; variable_number <= enum_variable_number_t_max; variable_number++) {
if((req_variable_number_all == VARIABLE_NUMBER_ALL_ALL_VARIABLES) | (req_variable_number_all == variable_number)) {
if(variable_is_analog_by_enum(variable_number)) {
analog_variable_t* p_variable = analog_variable_get_pointer_by_enum(variable_number);
......@@ -41,8 +42,8 @@ err_t command_SENSOR_MAXVALUE_RESET(void) {
p_variable->value_max = 0;
INTERRUPT_GlobalInterruptEnable();
}
}
}
}
}
// Auto-generated section: response payload fields writing
communication_response_payload_appender_reset();
......
......@@ -61,8 +61,8 @@ void communication_parser_appendbyte(uint8_t _byte) {
_checksum_update(_byte);
// some space allocated for temporary data
command_info_t* tmp_p_cmdinfo;
uint8_t tmp_nibble_even;
uint8_t tmp_nibble_odd;
static uint8_t tmp_nibble_even; // these value must be remembered between calls
static uint8_t tmp_nibble_odd; // these value must be remembered between calls
uint8_t tmp_new_byte;
err_t retval;
// switch-case for the communication parser state machine
......
......@@ -10,6 +10,7 @@
#include "hardware.h"
#include "errorcodes.h"
#include "generated/sources/variables.h"
#include "spurious.h"
err_t errors_last_error = NOERR;
......@@ -63,11 +64,11 @@ void error_die_forever_fromIRQ(void) {
// TODO COMMENT OUT error_die_forever_fromIRQ
INTERRUPT_GlobalInterruptDisable();
while(1) {
userpin_SWITCH_LED_D9_set_high();
userpin_SWITCH_LED_D10_set_low();
userpin_SWITCH_LED_D9_set_high_fromIRQ();
userpin_SWITCH_LED_D10_set_low_fromIRQ();
__delay_ms(250);
userpin_SWITCH_LED_D9_set_low();
userpin_SWITCH_LED_D10_set_high();
userpin_SWITCH_LED_D9_set_low_fromIRQ();
userpin_SWITCH_LED_D10_set_high_fromIRQ();
__delay_ms(250);
}
}
......@@ -68,14 +68,14 @@ void __interrupt() INTERRUPT_InterruptManager (void)
{
TMR2_ISR();
}
else if(PIE1bits.TX1IE == 1 && PIR1bits.TX1IF == 1)
{
EUSART1_TxDefaultInterruptHandler();
}
else if(PIE1bits.RC1IE == 1 && PIR1bits.RC1IF == 1)
{
EUSART1_RxDefaultInterruptHandler();
}
else if(PIE1bits.TX1IE == 1 && PIR1bits.TX1IF == 1)
{
EUSART1_TxDefaultInterruptHandler();
}
else
{
//Unhandled Interrupt
......
......@@ -80,8 +80,8 @@
<itemPath>commands/command_RESCUE_TIMEOUT_GET.c</itemPath>
<itemPath>commands/command_RESCUE_TIMEOUT_SET.c</itemPath>
<itemPath>commands/command_ALARM_ENABLE_GETALL.c</itemPath>
<itemPath>commands/command_ALARM_FIRECOUNT_GETALL.c</itemPath>
<itemPath>commands/command_ALARM_FIRED_GETALL.c</itemPath>
<itemPath>commands/command_ALARM_FIRECOUNT_GETALL.c</itemPath>
<itemPath>commands/command_ALARM_MAXCOUNT_GETALL.c</itemPath>
</logicalFolder>
<logicalFolder name="generated" displayName="generated" projectFiles="true">
......@@ -136,7 +136,7 @@
<targetPluginBoard></targetPluginBoard>
<platformTool>noID</platformTool>
<languageToolchain>XC8</languageToolchain>
<languageToolchainVersion>2.20</languageToolchainVersion>
<languageToolchainVersion>2.00</languageToolchainVersion>
<platform>2</platform>
</toolsSet>
<packs>
......@@ -277,7 +277,7 @@
<targetPluginBoard></targetPluginBoard>
<platformTool>ICD3PlatformTool</platformTool>
<languageToolchain>XC8</languageToolchain>
<languageToolchainVersion>2.20</languageToolchainVersion>
<languageToolchainVersion>2.00</languageToolchainVersion>
<platform>2</platform>
</toolsSet>
<packs>
......
......@@ -68,6 +68,30 @@ void switch_SWITCH_LBL_set_open_fromIRQ(void) {
switches.state_SWITCH_LBL = SWITCHSTATE_OPEN;
}
// ...see .h
void userpin_SWITCH_LED_D9_set_high_fromIRQ(void) {
DOUT_JP1_LED_D9_SetHigh();
userpins.state_SWITCH_LED_D9 = PINSTATE_HIGH;
}
// ...see .h
void userpin_SWITCH_LED_D9_set_low_fromIRQ(void) {
DOUT_JP1_LED_D9_SetLow();
userpins.state_SWITCH_LED_D9 = PINSTATE_LOW;
}
// ...see .h
void userpin_SWITCH_LED_D10_set_high_fromIRQ(void) {
DOUT_JP2_LED_D10_SetHigh();
userpins.state_SWITCH_LED_D10 = PINSTATE_HIGH;
}
// ...see .h
void userpin_SWITCH_LED_D10_set_low_fromIRQ(void) {
DOUT_JP2_LED_D10_SetLow();
userpins.state_SWITCH_LED_D10 = PINSTATE_LOW;
}
void dummy_alarm_callback(void) {
// should never be called
error_die_forever_fromIRQ();
......
......@@ -26,6 +26,11 @@ void switch_SWITCH_VEOC_RETURN_set_open_fromIRQ(void);
void switch_SWITCH_VEOC_DIRECT_set_open_fromIRQ(void);
void switch_SWITCH_HYDRO_set_open_fromIRQ(void);
void switch_SWITCH_LBL_set_open_fromIRQ(void);
// Same for LEDs
void userpin_SWITCH_LED_D9_set_high_fromIRQ(void);
void userpin_SWITCH_LED_D9_set_low_fromIRQ(void);
void userpin_SWITCH_LED_D10_set_high_fromIRQ(void);
void userpin_SWITCH_LED_D10_set_low_fromIRQ(void);
void dummy_alarm_callback(void);
......
......@@ -9,6 +9,7 @@
#include "configuration.h"
#include "generated/sources/variables.h"
#include "spurious.h"
// number of seconds elapsed since last received command
uint32_t _timing_seconds_lc = 0;
......@@ -72,8 +73,8 @@ void timing_tick_irq(void) {
// ONE second elapsed!
// TODO LED remove activity
if(userpin_SWITCH_LED_D9_get()) userpin_SWITCH_LED_D9_set_low();
else userpin_SWITCH_LED_D9_set_high();
if(userpin_SWITCH_LED_D9_get()) userpin_SWITCH_LED_D9_set_low_fromIRQ();
else userpin_SWITCH_LED_D9_set_high_fromIRQ();
// increment number of seconds since last received command
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment