[Promicro]
extends = nrf52_base
board = promicro_nrf52840
build_flags = ${nrf52_base.build_flags}
  -I variants/promicro
  -D PROMICRO
  -D USE_SX1262
  -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_BOARD_SCL=7
  -D PIN_BOARD_SDA=8
  -D PIN_OLED_RESET=-1
  -D PIN_USER_BTN=6
  -D PIN_GPS_RX=3
  -D PIN_GPS_TX=4
  -D PIN_GPS_EN=5
  -D ENV_INCLUDE_GPS=1
  -D ENV_INCLUDE_AHTX0=1
  -D ENV_INCLUDE_BME280=1
  -D ENV_INCLUDE_BMP280=1
  -D ENV_INCLUDE_INA3221=1
  -D ENV_INCLUDE_INA219=1
build_src_filter = ${nrf52_base.build_src_filter}
  +<helpers/sensors>
  +<../variants/promicro>
lib_deps= ${nrf52_base.lib_deps}
  adafruit/Adafruit SSD1306 @ ^2.5.13
  adafruit/Adafruit INA3221 Library @ ^1.0.1
  adafruit/Adafruit INA219 @ ^1.2.3
  adafruit/Adafruit AHTX0 @ ^2.0.5
  adafruit/Adafruit BME280 Library @ ^2.3.0
  adafruit/Adafruit BMP280 Library@^2.6.8
  stevemarple/MicroNMEA @ ^2.0.6

[env:ProMicro_repeater]
extends = Promicro
build_src_filter = ${Promicro.build_src_filter}
  +<../examples/simple_repeater>
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/ui/MomentaryButton.cpp>
build_flags =
  ${Promicro.build_flags}
  -D ADVERT_NAME='"ProMicro Repeater"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
  -D DISPLAY_CLASS=SSD1306Display
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps = ${Promicro.lib_deps}
  adafruit/RTClib @ ^2.1.3

[env:ProMicro_repeater_bridge_rs232_serial1]
extends = Promicro
build_src_filter = ${Promicro.build_src_filter}
  +<../examples/simple_repeater>
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<helpers/bridges/RS232Bridge.cpp>
build_flags =
  ${Promicro.build_flags}
  -D ADVERT_NAME='"RS232 Bridge"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
  -D DISPLAY_CLASS=SSD1306Display
  -D WITH_RS232_BRIDGE=Serial1
  -D WITH_RS232_BRIDGE_RX=PIN_SERIAL1_RX
  -D WITH_RS232_BRIDGE_TX=PIN_SERIAL1_TX
  -UENV_INCLUDE_GPS
;  -D BRIDGE_DEBUG=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps = ${Promicro.lib_deps}
  adafruit/RTClib @ ^2.1.3

[env:ProMicro_room_server]
extends = Promicro
build_src_filter = ${Promicro.build_src_filter}
  +<../examples/simple_room_server>
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/ui/MomentaryButton.cpp>
build_flags = ${Promicro.build_flags}
  -D ADVERT_NAME='"ProMicro Room"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D ROOM_PASSWORD='"hello"'
  -D DISPLAY_CLASS=SSD1306Display
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps = ${Promicro.lib_deps}
  adafruit/RTClib @ ^2.1.3

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

[env:ProMicro_companion_radio_usb]
extends = Promicro
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags = ${Promicro.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D DISPLAY_CLASS=SSD1306Display
  -D ENABLE_USB_INTERFACE
; NOTE: DO NOT ENABLE -->  -D MESH_PACKET_LOGGING=1
; NOTE: DO NOT ENABLE -->  -D MESH_DEBUG=1
build_src_filter = ${Promicro.build_src_filter}
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps = ${Promicro.lib_deps}
  adafruit/RTClib @ ^2.1.3
  densaugeo/base64 @ ~1.4.0

[env:ProMicro_companion_radio_ble]
extends = Promicro
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
build_flags = ${Promicro.build_flags}
  -I examples/companion_radio/ui-new
  -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 DISPLAY_CLASS=SSD1306Display
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Promicro.build_src_filter}
  +<helpers/nrf52/SerialBLEInterface.cpp>
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps = ${Promicro.lib_deps}
  adafruit/RTClib @ ^2.1.3
  densaugeo/base64 @ ~1.4.0

[env:ProMicro_sensor]
extends = Promicro
build_flags =
  ${Promicro.build_flags}
  -D ADVERT_NAME='"ProMicro Sensor"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D DISPLAY_CLASS=SSD1306Display
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Promicro.build_src_filter}
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/simple_sensor>
lib_deps =
  ${Promicro.lib_deps}

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