From 5f14b1f74db38ca9de4caef1e67fec7b7d59b54f Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Thu, 2 Feb 2023 00:42:28 +0100 Subject: [PATCH] Timer: Add callback "onEvery30s". --- avr/timer.asm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/avr/timer.asm b/avr/timer.asm index ad5b73b..9e080cf 100644 --- a/avr/timer.asm +++ b/avr/timer.asm @@ -132,11 +132,20 @@ Timer_Run_check1m: lds r16, timerModuleCounter1m inc r16 sts timerModuleCounter1m, r16 + cpi r16, 30 ; check for every 30s + brne Timer_Run_l4 + push r16 + push r17 + rcall onEvery30s + pop r17 + pop r16 +Timer_Run_l4: cpi r16, 60 brcs Timer_Run_l2 clr r16 sts timerModuleCounter1m, r16 push r17 + rcall onEvery30s rcall onEveryMinute pop r17