; ***************************************************************************
; copyright   : (C) 2026 by Martin Preuss
; email       : martin@libchipcard.de
;
; ***************************************************************************
; * This file is part of the project "AqHome".                              *
; * Please see toplevel file COPYING of that project for license details.   *
; ***************************************************************************

#ifndef AQH_AVR_DEVICES_ALL_MODULES_RUN_ASM
#define AQH_AVR_DEVICES_ALL_MODULES_RUN_ASM



; ***************************************************************************
; code

.cseg



; ---------------------------------------------------------------------------
; @routine modulesRun
;
; Call run functions of the used modules. Add your routine calls here.
;
; @return CFLAG set: at least one RUN routine returned CFLAG set
; @clobbers all

modulesRun:
  clr r16
  
  push r16
    bigcall BaseTimer_Run
  pop r16
  sbci r16, 0
  
#ifdef MODULES_TTYONUART1
  push r16
    bigcall TtyOnUart1_Run
  pop r16
#endif

#ifdef MODULES_UARTFD0
  push r16
    bigcall UARTFD0_Run
  pop r16
  sbci r16, 0
#endif

#ifdef MODULES_UARTFD1
  push r16
    bigcall UARTFD1_Run
  pop r16
  sbci r16, 0
#endif

#ifdef MODULES_COMONUART0
  push r16
    bigcall ComOnUart0_Run
  pop r16
  sbci r16, 0
#endif

#ifdef MODULES_COMONUART1
  push r16
    bigcall ComOnUart1_Run
  pop r16
  sbci r16, 0
#endif

#ifdef MODULES_COM2W
  push r16
    bigcall COM2W_Run
  pop r16
  sbci r16, 0
#endif

#ifdef MODULES_COM2W2
  push r16
    bigcall COM2W2_Run
  pop r16
  sbci r16, 0
#endif

#ifdef MODULES_COM2W0
  push r16
    bigcall COM2W0_Run
  pop r16
  sbci r16, 0
#endif

#ifdef MODULES_COM2W1
  push r16
    bigcall COM2W1_Run
  pop r16
  sbci r16, 0
#endif

#ifdef MODULES_COM2WN
  push r16
    bigcall COM2WN_Run
  pop r16
  sbci r16, 0
#endif

#ifdef MODULES_COM2WI
  push r16
    bigcall COM2WI_Run
  pop r16
  sbci r16, 0
#endif

  ; add more modules here

  ; check for repeat request
  tst r16
  clc
  breq modulesRun_end
  sec
modulesRun_end:
  ret
; @end




#endif


