[Nano_G2_Ultra]
extends = nrf52_base
board = nano-g2-ultra
board_build.ldscript = boards/nrf52840_s140_v6.ld
build_flags = ${nrf52_base.build_flags}
  -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
  -I variants/nano_g2_ultra
  -D NANO_G2_ULTRA
  -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 PIN_USER_BTN=38
build_src_filter = ${nrf52_base.build_src_filter}
  +<helpers/*.cpp>
  +<../variants/nano_g2_ultra>
debug_tool = jlink
upload_protocol = nrfutil
lib_deps = ${nrf52_base.lib_deps}
  adafruit/Adafruit SH110X @ ~2.1.13
  adafruit/Adafruit GFX Library @ ^1.12.1
  stevemarple/MicroNMEA @ ^2.0.6

[env:Nano_G2_Ultra_repeater]
extends = Nano_G2_Ultra
build_flags =
  ${Nano_G2_Ultra.build_flags}
  -D DISPLAY_CLASS=SH1106Display
  -D ADVERT_NAME='"Nano G2 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
build_src_filter = ${Nano_G2_Ultra.build_src_filter}
  +<helpers/ui/SH1106Display.cpp>
  +<../examples/simple_repeater>

[env:Nano_G2_Ultra_room_server]
extends = Nano_G2_Ultra
build_flags =
  ${Nano_G2_Ultra.build_flags}
  -D DISPLAY_CLASS=SH1106Display
  -D ADVERT_NAME='"Nano G2 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
build_src_filter = ${Nano_G2_Ultra.build_src_filter}
  +<helpers/ui/SH1106Display.cpp>
  +<../examples/simple_room_server>

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

[env:Nano_G2_Ultra_companion_radio_usb]
extends = Nano_G2_Ultra
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
  ${Nano_G2_Ultra.build_flags}
  -I src/helpers/ui
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D QSPIFLASH=1
  -D OFFLINE_QUEUE_SIZE=256
  -D DISPLAY_CLASS=SH1106Display
  -D PIN_BUZZER=4
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Nano_G2_Ultra.build_src_filter}
  +<helpers/ui/SH1106Display.cpp>
  +<helpers/ui/buzzer.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps = ${Nano_G2_Ultra.lib_deps}
  densaugeo/base64 @ ~1.4.0
  end2endzone/NonBlockingRTTTL@^1.3.0

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