[LilyGo_T-Echo_Card]
extends = rak4631_hw
board = t-echo
board_build.ldscript = boards/nrf52840_s140_v6.ld
build_flags = ${rak4631_hw.build_flags}
  -I variants/lilygo_techo_card
  -I src/helpers/nrf52
  -I lib/nrf52/s140_nrf52_6.1.1_API/include
  -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52
  -D LILYGO_TECHO_CARD
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D SX126X_CURRENT_LIMIT=140
  -D SX126X_RX_BOOSTED_GAIN=1
  -D HAS_NEOPIXEL=1
  -D HAS_TORCH=1
  -D DISABLE_DIAGNOSTIC_OUTPUT
  -D ENV_INCLUDE_GPS=1
  -D DISPLAY_CLASS=U8g2Display
  -D PIN_OLED_RESET=-1
build_src_filter = ${rak4631_hw.build_src_filter}
  +<helpers/*.cpp>
  +<TechoCardBoard.cpp>
  +<helpers/sensors/EnvironmentSensorManager.cpp>
  +<helpers/ui/U8g2Display.h>
  +<helpers/ui/MomentaryButton.cpp>
  +<../variants/lilygo_techo_card>
lib_deps =
  ${rak4631_hw.lib_deps}
  stevemarple/MicroNMEA @ ^2.0.6
  olikraus/U8g2 @ ^2.35.19
  adafruit/Adafruit NeoPixel@^1.10.0
  bakercp/CRC32 @ ^2.0.0
debug_tool = jlink
upload_protocol = nrfutil

[env:LilyGo_T-Echo_Card_repeater]
extends = LilyGo_T-Echo_Card
build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter}
  +<../examples/simple_repeater>
build_flags =
  ${LilyGo_T-Echo_Card.build_flags}
  -D ADVERT_NAME='"T-Echo Card Repeater"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
  ; -D MESH_PACKET_LOGGING=1
  ; -D MESH_DEBUG=1

[env:LilyGo_T-Echo_Card_room_server]
extends = LilyGo_T-Echo_Card
build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter}
  +<../examples/simple_room_server>
build_flags =
  ${LilyGo_T-Echo_Card.build_flags}
  -D ADVERT_NAME='"T-Echo Card Room"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  ; -D MESH_PACKET_LOGGING=1
  ; -D MESH_DEBUG=1

[env:LilyGo_T-Echo_Card_companion_radio_ble]
extends = LilyGo_T-Echo_Card
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
  ${LilyGo_T-Echo_Card.build_flags}
  -I src/helpers/ui
  -I examples/companion_radio/ui-tiny
  -D PIN_BUZZER=38
  -D QSPIFLASH=1
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D BLE_PIN_CODE=123456
  ; -D BLE_DEBUG_LOGGING=1
  -D OFFLINE_QUEUE_SIZE=256
  -D UI_RECENT_LIST_SIZE=3
  -D UI_GPS_PAGE=1
  ; -D MESH_PACKET_LOGGING=1
  ; -D MESH_DEBUG=1
  -D AUTO_SHUTDOWN_MILLIVOLTS=3300
build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter}
  +<helpers/nrf52/SerialBLEInterface.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-tiny/*.cpp>
  +<helpers/ui/buzzer.cpp>
lib_deps =
  ${LilyGo_T-Echo_Card.lib_deps}
  end2endzone/NonBlockingRTTTL@^1.3.0
  densaugeo/base64 @ ~1.4.0

[env:LilyGo_T-Echo_Card_companion_radio_usb]
extends = LilyGo_T-Echo_Card
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
  ${LilyGo_T-Echo_Card.build_flags}
  -I src/helpers/ui
  -I examples/companion_radio/ui-tiny
  -D PIN_BUZZER=38
  -D QSPIFLASH=1
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D OFFLINE_QUEUE_SIZE=256
  -D UI_RECENT_LIST_SIZE=3
  -D UI_GPS_PAGE=1
  ; -D MESH_PACKET_LOGGING=1
  ; -D MESH_DEBUG=1
  -D AUTO_SHUTDOWN_MILLIVOLTS=3300
build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter}
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-tiny/*.cpp>
  +<helpers/ui/buzzer.cpp>
lib_deps =
  ${LilyGo_T-Echo_Card.lib_deps}
  end2endzone/NonBlockingRTTTL@^1.3.0
  densaugeo/base64 @ ~1.4.0
