; ***************************************************************************
; copyright   : (C) 2025 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.   *
; ***************************************************************************


.include "devices/all/main.asm"
.include "devices/all/apps.asm"
.include "devices/all/modules.asm"
#ifdef MODULES_NETWORK
 .include "devices/all/sendvalue.asm"
#endif
.include "devices/all/data.asm"

.include "common/utils.asm"
.include "common/utils_initial_wait.asm"
.include "common/utils_wait_fixed.asm"
.include "common/utils_copy_from_flash.asm"
.include "common/utils_copy_sdram.asm"

.include "modules/basetimer/main.asm"

#ifdef MODULES_XRAM
.include "modules/xram/main.asm"
#endif

#ifdef MODULES_HEAP
  .include "modules/heap/main.asm"
#endif

#ifdef MODULES_NETWORK
.include "common/crc8.asm"
.include "common/m_fixedbuffers.asm"
.include "common/m_ringbuffer_y.asm"
.include "common/ringbuffer_y.asm"
.include "modules/network/defs.asm"
.include "modules/network/data.asm"
.include "modules/network/iface.asm"
.include "modules/network/main.asm"
.include "modules/network/buffer.asm"
.include "modules/network/msg/defs.asm"
.include "modules/network/msg/common.asm"
.include "modules/network/msg/crc.asm"
.include "modules/network/msg/value-w.asm"
.include "modules/network/msg/value-r.asm"
.include "modules/network/msg/addr-r.asm"
.include "modules/network/msg/addr-w.asm"
#endif

#ifdef MODULES_UART_BITBANG
.include "modules/uart_bitbang2/defs.asm"
.include "modules/uart_bitbang2/iface.asm"
.include "modules/uart_bitbang2/bytelevel.asm"
.include "modules/uart_bitbang2/msglevel.asm"
#endif

#ifdef MODULES_UART_HW
.include "modules/uart_hw/defs.asm"
.include "modules/uart_hw/lowlevel.asm"
.include "modules/uart_hw/uart.asm"
.include "modules/uart_hw/attn.asm"
.include "modules/uart_hw/net_uart.asm"
#endif


#ifdef MODULES_COMONUART0
;.include "modules/uart_hw/defs.asm"
;.include "modules/uart_hw/lowlevel.asm"
;.include "modules/uart_hw/m_lowlevel_uart.asm"
;.include "modules/uart_hw/comonuart0.asm"
.include "modules/uart_hw2/defs.asm"
.include "modules/uart_hw2/comonuart0.asm"
#endif

#ifdef MODULES_COMONUART1
;.include "modules/uart_hw/defs.asm"
;.include "modules/uart_hw/lowlevel.asm"
;.include "modules/uart_hw/m_lowlevel_uart.asm"
;.include "modules/uart_hw/comonuart1.asm"
.include "modules/uart_hw2/defs.asm"
.include "modules/uart_hw2/comonuart1.asm"
#endif


#ifdef MODULES_TTYONUART1
.include "modules/uart_hw/defs.asm"
.include "modules/uart_hw/lowlevel.asm"
.include "modules/uart_hw/m_lowlevel_uart.asm"
.include "modules/uart_hw/ttyonuart1.asm"
;.include "modules/uart_hw2/defs.asm"
;.include "modules/uart_hw2/ttyonuart1.asm"
#endif



#ifdef MODULES_COM2W
.include "modules/com2w/defs.asm"
.include "modules/com2w/com2w.asm"
#endif



#ifdef MODULES_COM2W0
.include "modules/com2w/defs.asm"
.include "modules/com2w/common.asm"
.include "modules/com2w/com2w0.asm"
#endif



#ifdef MODULES_COM2W1
.include "modules/com2w/defs.asm"
.include "modules/com2w/common.asm"
.include "modules/com2w/com2w1.asm"
#endif



#ifdef MODULES_COM2WN
.include "modules/com2w/defs.asm"
.include "modules/com2w/com2wn_init.asm"
.include "modules/com2w/com2wn_io.asm"
.include "modules/com2w/com2wn_irq.asm"
.include "modules/com2w/com2wn_recv.asm"
.include "modules/com2w/com2wn_run.asm"
.include "modules/com2w/com2wn_send.asm"
.include "modules/com2w/com2wn_wait.asm"
.include "modules/com2w/com2wn_data.asm"
#endif



#ifdef MODULES_COM2WI
.include "modules/com2w/com2wi2.asm"
#endif



#ifdef MODULES_UARTFD0
.include "modules/uart_fd/defs.asm"
.include "modules/uart_fd/macros.asm"
.include "modules/uart_fd/uartfd0.asm"
#endif



#ifdef MODULES_UARTFD1
.include "modules/uart_fd/defs.asm"
.include "modules/uart_fd/macros.asm"
.include "modules/uart_fd/uartfd1.asm"
#endif



#ifdef MODULES_CLOCK
.include "modules/clock/main.asm"
#endif

#ifdef MODULES_LED_SIMPLE
.include "modules/led_simple/main.asm"
  #ifdef MODULES_NETWORK
  .include "modules/led_simple/recv.asm"
  #endif
#endif

#ifdef MODULES_LED_SIGNAL
.include "modules/led_signal/main.asm"
#endif


#ifdef MODULES_LED_ACTIVITY
.include "modules/led_activity/main.asm"
#endif


#ifdef MODULES_TWI_MASTER
.include "modules/twimaster/main.asm"
#endif

#ifdef MODULES_SI7021
.include "modules/si7021/main2.asm"
  #ifdef MODULES_NETWORK
  .include "modules/si7021/send.asm"
  #endif
.include "common/multiply.asm"
#endif

#ifdef MODULES_SGP30
.include "modules/sgp30/main.asm"
  #ifdef MODULES_NETWORK
  .include "modules/sgp30/send.asm"
  #endif
#endif

#ifdef MODULES_SGP40
.include "modules/sgp40/main.asm"
  #ifdef MODULES_NETWORK
  .include "modules/sgp40/send.asm"
  #endif
#endif

#ifdef MODULES_OWI_MASTER
.include "modules/owimaster/main.asm"
#endif


#ifdef MODULES_SPI_HW
.include "modules/spi_hw/main.asm"
#endif

#ifdef MODULES_DS18B20
.include "modules/ds18b20/main2.asm"
  #ifdef MODULES_NETWORK
    .include "modules/ds18b20/send.asm"
  #endif
#endif

#ifdef MODULES_MOTION
.include "modules/motion/main2.asm"
#endif

#ifdef MODULES_CCS811
  .include "modules/ccs811/main.asm"
  #ifdef MODULES_NETWORK
    .include "modules/ccs811/send.asm"
  #endif
#endif

#ifdef MODULES_TCRT1000
  .include "modules/tcrt1000/main2.asm"
#endif

#ifdef MODULES_SK6812
  .include "modules/sk6812/main.asm"
  #ifdef MODULES_NETWORK
    .include "modules/sk6812/recv.asm"
  #endif
#endif

#ifdef MODULES_LCD
  .include "modules/lcd/main.asm"
#endif

#ifdef MODULES_ILI9341
.include "modules/lcd2/ili9341/defs.asm"
.include "modules/lcd2/ili9341/colors.asm"
.include "modules/lcd2/ili9341/images.asm"
.include "modules/lcd2/ili9341/main.asm"
.include "modules/lcd2/ili9341/io_spi.asm"
.include "modules/lcd2/ili9341/graphops.asm"
.include "modules/lcd2/ili9341/text.asm"
#endif

#ifdef MODULES_XPT2046
.include "modules/lcd2/xpt2046/main.asm"
#endif

#ifdef MODULES_FONT
.include "modules/lcd2/font/defs.asm"
.include "modules/lcd2/font/main.asm"
#endif

#ifdef MODULES_WIN
.include "common/list.asm"
.include "common/tree.asm"
.include "modules/lcd2/win/defs.asm"
.include "modules/lcd2/win/object.asm"
.include "modules/lcd2/win/widget.asm"
.include "modules/lcd2/win/gui.asm"
#endif



#ifdef MODULES_GUI
.include "modules/lcd2/gui/defs.asm"
.include "modules/lcd2/gui/main.asm"
.include "modules/lcd2/gui/window.asm"
#endif


#ifdef MODULES_FONT_8X8
.include "modules/lcd2/font/defs.asm"
.include "modules/lcd2/font/font8x8.asm"
#endif


#ifdef MODULES_FONT_6X8
.include "modules/lcd2/font/defs.asm"
.include "modules/lcd2/font/font6x8.asm"
#endif


#ifdef MODULES_BRIGHTNESS
.include "modules/brightness/main.asm"
  #ifdef MODULES_NETWORK
    .include "modules/brightness/send.asm"
  #endif
#endif


#ifdef APPS_MOTION
.include "modules/f_keepup/main.asm"
.include "modules/valsched/main.asm"
.include "apps/motion/main.asm"
#endif


#ifdef APPS_DOOR
#ifndef APPS_MOTION
.include "modules/f_keepup/main.asm"
.include "modules/valsched/main.asm"
#endif
.include "apps/door/main.asm"
#endif


#ifdef APPS_NETWORK
.include "apps/network/main.asm"
.include "modules/network/msg/reboot-d.asm"
.include "modules/network/msg/reboot-r.asm"
.include "modules/network/msg/pong-w.asm"
.include "modules/network/msg/range-d.asm"
.include "modules/network/msg/range-r.asm"
.include "common/eeprom-r.asm"
.include "common/eeprom-w.asm"
#endif


#ifdef APPS_ROUTER
.include "apps/router/main.asm"
.include "modules/network/msg/reboot-d.asm"
.include "modules/network/msg/reboot-r.asm"
.include "modules/network/msg/pong-w.asm"
.include "modules/network/msg/range-d.asm"
.include "modules/network/msg/range-r.asm"
.include "modules/network/msg/range-w.asm"
.include "common/eeprom-r.asm"
.include "common/eeprom-w.asm"
#endif


#ifdef APPS_HUB
.include "apps/hub/main.asm"
.include "modules/network/msg/reboot-d.asm"
.include "modules/network/msg/reboot-r.asm"
.include "modules/network/msg/pong-w.asm"
.include "modules/network/msg/range-d.asm"
.include "modules/network/msg/range-r.asm"
.include "modules/network/msg/range-w.asm"
.include "common/eeprom-r.asm"
.include "common/eeprom-w.asm"
#endif


#ifdef APPS_FORWARDER
.include "apps/forwarder/main.asm"
.include "modules/network/msg/reboot-r.asm"
.include "modules/network/msg/reboot-d.asm"
.include "modules/network/msg/pong-w.asm"
#endif


#ifdef APPS_REPORTSENSORS
.include "apps/reportsensors/data.asm"
.include "apps/reportsensors/main.asm"
#endif


#ifdef APPS_STATS
.include "apps/stats/data.asm"
.include "apps/stats/main.asm"
.include "apps/network/stats.asm"
.include "modules/network/msg/sendstats-w.asm"
.include "modules/network/msg/recvstats-w.asm"
.include "modules/network/msg/memstats-w.asm"
.include "modules/network/msg/device-w.asm"
#endif


#ifdef APPS_MA_LIGHT
.include "apps/ma_light/defs.asm"
.include "apps/ma_light/data.asm"
.include "apps/ma_light/main.asm"
.include "apps/ma_light/recv.asm"
;.include "common/eeprom-r.asm"
;.include "common/eeprom-w.asm"
#endif



