[Heltec_t1]
extends = nrf52_base
board = heltec_t1
board_build.ldscript = boards/nrf52840_s140_v6.ld
build_flags = ${nrf52_base.build_flags}
  ${sensor_base.build_flags}
  -I lib/nrf52/s140_nrf52_6.1.1_API/include
  -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52
  -I variants/heltec_t1
  -I src/helpers/ui
  -D HELTEC_T1
  -D NRF52_POWER_MANAGEMENT
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D DISPLAY_CLASS=ST7735Display
build_src_filter = ${nrf52_base.build_src_filter}
  +<helpers/*.cpp>
  +<helpers/sensors>
  +<../variants/heltec_t1>
  +<helpers/ui/ST7735Display.cpp>
  +<helpers/ui/MomentaryButton.cpp>
lib_deps =
  ${nrf52_base.lib_deps}
  ${sensor_base.lib_deps}
  adafruit/Adafruit ST7735 and ST7789 Library @ ^1.11.0
debug_tool = jlink
upload_protocol = nrfutil

[env:Heltec_t1_repeater]
extends = Heltec_t1
build_src_filter = ${Heltec_t1.build_src_filter}
  +<../examples/simple_repeater>

build_flags =
  ${Heltec_t1.build_flags}
  -D ADVERT_NAME='"Heltec_t1 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:Heltec_t1_room_server]
extends = Heltec_t1
build_src_filter = ${Heltec_t1.build_src_filter}
  +<../examples/simple_room_server>
build_flags =
  ${Heltec_t1.build_flags}
  -D ADVERT_NAME='"Heltec_t1 Room"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D ROOM_PASSWORD='"hello"'
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1

[env:Heltec_t1_companion_radio_ble]
extends = Heltec_t1
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
  ${Heltec_t1.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D BLE_PIN_CODE=123456
  -D ENV_INCLUDE_GPS=1
;  -D BLE_DEBUG_LOGGING=1
  -D OFFLINE_QUEUE_SIZE=256
  ; -D MESH_PACKET_LOGGING=1
  ; -D MESH_DEBUG=1
build_src_filter = ${Heltec_t1.build_src_filter}
  +<helpers/nrf52/SerialBLEInterface.cpp>
  +<helpers/ui/buzzer.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Heltec_t1.lib_deps}
  densaugeo/base64 @ ~1.4.0
  end2endzone/NonBlockingRTTTL@^1.3.0

[env:Heltec_t1_companion_radio_usb]
extends = Heltec_t1
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
  ${Heltec_t1.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Heltec_t1.build_src_filter}
  +<helpers/nrf52/*.cpp>
  +<helpers/ui/buzzer.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Heltec_t1.lib_deps}
  densaugeo/base64 @ ~1.4.0
  end2endzone/NonBlockingRTTTL@^1.3.0

[env:Heltec_t1_kiss_modem]
extends = Heltec_t1
build_src_filter = ${Heltec_t1.build_src_filter}
  +<../examples/kiss_modem/>
