From 144ef322524c6ebdf917d3cddaf1a9290c43ffce Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Sun, 22 Jan 2023 17:46:46 +0100 Subject: [PATCH] avr: enabled COM_Run. --- avr/main.asm | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/avr/main.asm b/avr/main.asm index e643484..516d782 100644 --- a/avr/main.asm +++ b/avr/main.asm @@ -90,6 +90,15 @@ ledA3Sram: .byte LED_SRAM_SIZE + +; *************************************************************************** +; data in EEPROM + +.eseg + + + + ; *************************************************************************** ; data in FLASH @@ -181,14 +190,21 @@ initModules: runModulesUntilIdle: -runModulesUntilIdle_Timer: ; repeat this block for every module with run function - rcall Timer_Run ; - brcs runModulesUntilIdle_Timer ; + ; TIMER module + rcall Timer_Run + ; COM module (call until carry flag cleared but at most 10 times to not starve other modules) + ldi r16, 10 runModulesUntilIdle_Com: - rcall Com_Run - brcs runModulesUntilIdle_Com + push r16 + rcall Com_Run + pop r16 + brcc runModulesUntilIdle_ComEnd + dec r16 + brne runModulesUntilIdle_Com +runModulesUntilIdle_ComEnd: + ; add more modules here ret