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