diff --git a/avr/apps/fan_control/main.asm b/avr/apps/fan_control/main.asm index 2f08cdb..8e93b27 100644 --- a/avr/apps/fan_control/main.asm +++ b/avr/apps/fan_control/main.asm @@ -201,6 +201,7 @@ appFanControlWriteEeprom_ret: appFanControlActorOn: ldd r16, Y+APP_FANCONTROL_RAM_OFFS_VALUE_LO rcall appFanControlSetFanDutyFromTable + bigcall AppFanControl_ReportState ret ; @end @@ -214,7 +215,9 @@ appFanControlActorOn: appFanControlActorOff: clr r16 - rjmp appFanControlSetFanDutyFromTable + rcall appFanControlSetFanDutyFromTable + bigcall AppFanControl_ReportState + ret ; @end diff --git a/avr/apps/fan_control/send.asm b/avr/apps/fan_control/send.asm new file mode 100644 index 0000000..557890e --- /dev/null +++ b/avr/apps/fan_control/send.asm @@ -0,0 +1,53 @@ +; *************************************************************************** +; copyright : (C) 2026 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + +#ifndef AQH_AVR_APPS_FAN_CONTROL_SEND_ASM +#define AQH_AVR_APPS_FAN_CONTROL_SEND_ASM + +.cseg + + +; --------------------------------------------------------------------------- +; @routine AppFanControl_ReportState +; +; @clobbers R16, R17, R18, R19, R20, R21, R22, R23, R24, R25, X + +AppFanControl_ReportState: + push yl + push yh + push zl + push zh + ldi zl, LOW(appFanControlObjectFlash*2) + ldi zh, HIGH(appFanControlObjectFlash*2) + lpm yl, Z+ + lpm yh, Z + sbiw zh:zl, 1 + + ldd r16, Y+HTIM_RAM_OFFS_FLAGS + clr r18 + sbrc r16, HTIM_FLAGBIT_STATE + inc r18 + ldi r17, VALUE_ID_FANCTRL_STATE + clr r19 + ldi r20, 1 + clr r21 + ldi r22, AQHOME_VALUETYPE_ONOFF + rcall Main_SendValueReport ; (R16, R17, R18, R19, R20, R21, R23, R24, R25, X) + pop zh + pop zl + pop yh + pop yl + ret +; @end + + + + +#endif + diff --git a/avr/apps/light_control/main.asm b/avr/apps/light_control/main.asm index 8ea4ec4..7380ce7 100644 --- a/avr/apps/light_control/main.asm +++ b/avr/apps/light_control/main.asm @@ -11,7 +11,7 @@ #define AQH_AVR_APPS_LIGHT_CONTROL_MAIN_ASM -.equ APP_LIGHTCONTROL_LIGHT_LIMIT = 15 +.equ APP_LIGHTCONTROL_LIGHT_LIMIT = 20 @@ -139,9 +139,10 @@ appLightControlUpdate: appLightControlUpdate_auto: sbr r16, (1< + +