added modules for SGP30/40.

This commit is contained in:
Martin Preuss
2025-05-14 23:18:26 +02:00
parent fee3606a61
commit faa46c7e38
15 changed files with 771 additions and 11 deletions

View File

@@ -53,6 +53,13 @@ AppReportSensors_Fini:
;
AppReportSensors_OnEverySecond:
in r15, SREG
push r15
cli
rcall AppReportSensors_OnEverySecond_noIrqs
out SREG, r15
ret
AppReportSensors_OnEverySecond_noIrqs:
lds r16, reportSensorTimer
inc r16
cpi r16, APP_REPORT_SENSORS_INTERVAL_SECS
@@ -60,6 +67,13 @@ AppReportSensors_OnEverySecond:
clr r16
AppReportSensors_OnEverySecond_store:
sts reportSensorTimer, r16
#ifdef MODULES_SGP30
; push r16
; rcall SGP30_Measure
; pop r16
#endif
#ifdef MODULES_SI7021
cpi r16, 1
breq AppReportSensors_OnEverySecond_measureValue1
@@ -70,11 +84,30 @@ AppReportSensors_OnEverySecond_store:
cpi r16, 49
breq AppReportSensors_OnEverySecond_sendValue2
#endif
#ifdef MODULES_SGP40
cpi r16, 27
breq AppReportSensors_OnEverySecond_measureValue4
cpi r16, 55
breq AppReportSensors_OnEverySecond_sendValue4
#endif
#ifdef MODULES_SGP30
cpi r16, 29
breq AppReportSensors_OnEverySecond_measureValue5
cpi r16, 57
breq AppReportSensors_OnEverySecond_sendValue5
cpi r16, 59
breq AppReportSensors_OnEverySecond_sendValue6
#endif
#ifdef MODULES_DS18B20
cpi r16, 9
breq AppReportSensors_OnEverySecond_sendValue3
#endif
ret
#ifdef MODULES_SI7021
AppReportSensors_OnEverySecond_measureValue1:
rjmp SI7021_MeasureTemp
@@ -85,10 +118,29 @@ AppReportSensors_OnEverySecond_sendValue1:
AppReportSensors_OnEverySecond_sendValue2:
rjmp SI7021_SendHumidity
#endif
#ifdef MODULES_DS18B20
AppReportSensors_OnEverySecond_sendValue3:
rjmp Ds18b20_SendTemperature
#endif
#ifdef MODULES_SGP40
AppReportSensors_OnEverySecond_measureValue4:
rjmp SGP40_MeasureRawSignal
AppReportSensors_OnEverySecond_sendValue4:
rjmp SGP40_SendTVOC
#endif
#ifdef MODULES_SGP30
AppReportSensors_OnEverySecond_measureValue5:
rjmp SGP30_Measure
AppReportSensors_OnEverySecond_sendValue5:
rjmp SGP30_SendTVOC
ret
AppReportSensors_OnEverySecond_sendValue6:
rjmp SGP30_SendCO2
#endif
; @end