From a7adf15bf6996fb7da656fdba991de3f4078e393 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Tue, 17 Dec 2024 20:53:37 +0100 Subject: [PATCH] avr: call Motion_Run if enabled. --- avr/main_all.asm | 9 +++++++++ avr/modules/motion/main.asm | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/avr/main_all.asm b/avr/main_all.asm index dd78341..f730cb4 100644 --- a/avr/main_all.asm +++ b/avr/main_all.asm @@ -219,6 +219,15 @@ runModules_ComEnd: rcall Ds18b20_Run #endif +#ifdef MODULES_MOTION + rcall Motion_Run +#endif + + +#ifdef MODULES_MOTION_LIGHT +; rcall MotionLight_Run +#endif + #ifdef MODULES_TCRT1000 rcall TCRT1K_Run diff --git a/avr/modules/motion/main.asm b/avr/modules/motion/main.asm index 2263d8a..86d6a9c 100644 --- a/avr/modules/motion/main.asm +++ b/avr/modules/motion/main.asm @@ -15,9 +15,10 @@ .equ MOTION_SEND_2_AFTER = 11 ; send motion message after 1100ms .equ MOTION_RESTART_AFTER = 100 ; restart motion report counter after 10s - .equ MOTION_UPCOUNTER_VALUE = 50 ; keep MOTION state active for at least 5s +.equ MOTION_FLAGS_REPORT_MOTION_BIT = 0 + ; *************************************************************************** @@ -26,6 +27,7 @@ .dseg motionDataBegin: + motionFlags: .byte 1 motionStateCounter: .byte 1 motionUpCounter: .byte 1 motionDataEnd: @@ -76,6 +78,30 @@ Motion_Fini: +; --------------------------------------------------------------------------- +; @routine Motion_Run @global +; +; @clobbers none + +Motion_Run: + lds r16, motionFlags + andi r16, (1<