fan_control: fixed setting of default mode, moved FLAGBIT_UPDATED to TCA.

This commit is contained in:
Martin Preuss
2026-08-07 00:39:40 +02:00
parent bbb6c4ac7d
commit db53d0d905
2 changed files with 3 additions and 6 deletions

View File

@@ -31,8 +31,5 @@
.equ APP_FANCONTROL_EE_SIZE = APP_FANCONTROL_EE_OFFS_BEGIN+2
.equ APP_FANCONTROL_FLAGBIT_UPDATED = 0 ; value updated (move to TCA!)
#endif

View File

@@ -60,7 +60,7 @@ AppFanControl_Init:
; ldi r16, 2
ldi r16, 1
std Y+HTIM_EE_OFFS_MODE, r16
std Y+HTIM_RAM_OFFS_MODE, r16
; setup from eeprom
push yl
@@ -91,10 +91,10 @@ AppFanControl_OnEveryTick:
; check update flag
ldd r16, Y+HTIM_RAM_OFFS_FLAGS
sbrs r16, APP_FANCONTROL_FLAGBIT_UPDATED
sbrs r16, TCA_FLAGBIT_UPDATED
rjmp AppFanControl_OnEveryTick_ret ; jump if clear (value unchanged)
; value updated
cbr r16, (1<<APP_FANCONTROL_FLAGBIT_UPDATED) ; clear update bit
cbr r16, (1<<TCA_FLAGBIT_UPDATED) ; clear update bit
std Y+HTIM_RAM_OFFS_FLAGS, r16
rcall appFanControlWriteEeprom
rcall appFanControlUpdate