comparison Small_CPU/Src/externalInterface.c @ 738:30717de00f3a

Added data init function for external interface: If external sensors have been removed while OSTC was sleeping then (in case of digital sensor) an old value was displayed. By initializing the data structures after wakeup this is now avoided.
author Ideenmodellierer
date Thu, 02 Feb 2023 17:19:24 +0100
parents 2a801cfe23ab
children e23fe82cbf8c
comparison
equal deleted inserted replaced
737:5071d554aaa5 738:30717de00f3a
81 externalInterfacePresent = 1; 81 externalInterfacePresent = 1;
82 global.deviceDataSendToMaster.hw_Info.extADC = 1; 82 global.deviceDataSendToMaster.hw_Info.extADC = 1;
83 } 83 }
84 global.deviceDataSendToMaster.hw_Info.checkADC = 1; 84 global.deviceDataSendToMaster.hw_Info.checkADC = 1;
85 85
86 /* init data values */ 86 externalInterface_InitDatastruct();
87 }
88
89 void externalInterface_InitDatastruct(void)
90 {
91 uint8_t index = 0;
92 /* init data values */
87 externalV33_On = 0; 93 externalV33_On = 0;
88 externalCO2Value = 0; 94 externalCO2Value = 0;
89 externalCO2SignalStrength = 0; 95 externalCO2SignalStrength = 0;
90 externalCO2Status = 0; 96 externalCO2Status = 0;
91 externalAutoDetect = DETECTION_OFF; 97 externalAutoDetect = DETECTION_OFF;
98
99 for(index = 0; index < MAX_ADC_CHANNEL; index++)
100 {
101 externalChannel_mV[index] = 0.0;
102 }
92 } 103 }
93 104
94 105
95 uint8_t externalInterface_StartConversion(uint8_t channel) 106 uint8_t externalInterface_StartConversion(uint8_t channel)
96 { 107 {