[R1Neo]
extends = nrf52_base
board = rak4631
board_check = true
build_flags = ${nrf52_base.build_flags}
  ${sensor_base.build_flags}
  -I variants/muziworks_r1_neo
  -I src/helpers/ui
  -D R1Neo
  -D NRF52_POWER_MANAGEMENT
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D DISPLAY_CLASS=NullDisplayDriver
  -D LORA_TX_POWER=22
  -D SX126X_CURRENT_LIMIT=140
  -D SX126X_RX_BOOSTED_GAIN=1
  -D PIN_BUZZER=3
  -D PIN_USER_BTN=26
  -D USER_BTN_PRESSED=HIGH
  -D PIN_GPS_TX=25
  -D PIN_GPS_RX=24
  -D PIN_GPS_EN=33
build_src_filter = ${nrf52_base.build_src_filter}
  +<../variants/muziworks_r1_neo>
  +<helpers/ui/MomentaryButton.cpp>
  +<helpers/ui/NullDisplayDriver.cpp>
  +<helpers/sensors>
lib_deps =
  ${nrf52_base.lib_deps}
  ${sensor_base.lib_deps}
  sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27

[env:R1Neo_repeater]
extends = R1Neo
build_flags =
  ${R1Neo.build_flags}
  -D ADVERT_NAME='"R1 Neo 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 = ${R1Neo.build_src_filter}
  +<../examples/simple_repeater>

[env:R1Neo_room_server]
extends = R1Neo
build_flags =
  ${R1Neo.build_flags}
  -D ADVERT_NAME='"R1 Neo Test 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 = ${R1Neo.build_src_filter}
  +<../examples/simple_room_server>

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

[env:R1Neo_companion_radio_ble]
extends = R1Neo
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags =
  ${R1Neo.build_flags}
  -I examples/companion_radio/ui-orig
  -D ENV_INCLUDE_GPS=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 MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${R1Neo.build_src_filter}
  +<helpers/ui/buzzer.cpp>
  +<helpers/nrf52/SerialBLEInterface.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-orig/*.cpp>
lib_deps =
  ${R1Neo.lib_deps}
  densaugeo/base64 @ ~1.4.0
  end2endzone/NonBlockingRTTTL@^1.3.0

[env:R1Neo_terminal_chat]
extends = R1Neo
build_flags =
  ${R1Neo.build_flags}
  -D MAX_CONTACTS=100
  -D MAX_GROUP_CHANNELS=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${R1Neo.build_src_filter}
  +<../examples/simple_secure_chat/main.cpp>
lib_deps =
  ${R1Neo.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:R1Neo_sensor]
extends = R1Neo
build_flags =
  ${R1Neo.build_flags}
  -D DISPLAY_CLASS=SSD1306Display
  -D ADVERT_NAME='"R1 Neo Sensor"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${R1Neo.build_src_filter}
  +<../examples/simple_sensor>

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