[wio_wm1110]
extends = nrf52_base
board = seeed-xiao-afruitnrf52-nrf52840
board_build.ldscript = boards/nrf52840_s140_v7.ld
build_flags = ${nrf52_base.build_flags}
  ${sensor_base.build_flags}
  -I lib/nrf52/s140_nrf52_7.3.0_API/include
  -I lib/nrf52/s140_nrf52_7.3.0_API/include/nrf52
  -I variants/wio_wm1110
  -D NRF52_PLATFORM
  -D WIO_WM1110
;  -D MESH_DEBUG=1
  -D RADIO_CLASS=CustomLR1110
  -D WRAPPER_CLASS=CustomLR1110Wrapper
  -D LORA_TX_POWER=22
  -D RX_BOOSTED_GAIN=true
  -D P_LORA_DIO_1=40
  -D P_LORA_RESET=42
  -D P_LORA_BUSY=43
  -D P_LORA_NSS=44
  -D P_LORA_SCLK=45
  -D P_LORA_MOSI=46
  -D P_LORA_MISO=47
  -D LR11X0_DIO_AS_RF_SWITCH=true
  -D LR11X0_DIO3_TCXO_VOLTAGE=1.8
  -D RF_SWITCH_TABLE
  -D ENV_INCLUDE_GPS=0
build_src_filter = ${nrf52_base.build_src_filter}
  +<helpers/*.cpp>
  +<helpers/sensors>
  +<../variants/wio_wm1110>
debug_tool = jlink
upload_protocol = jlink
lib_deps = ${nrf52_base.lib_deps}
  ${sensor_base.lib_deps}
  adafruit/Adafruit LIS3DH @ ^1.2.4
  adafruit/Adafruit SHT4x Library @ ^1.0.4

[env:wio_wm1110_repeater]
extends = wio_wm1110
build_flags =
  ${wio_wm1110.build_flags}
  -D ADVERT_NAME='"WM1110 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 = ${wio_wm1110.build_src_filter}
  +<../examples/simple_repeater/*.cpp>

[env:wio_wm1110_room_server]
extends = wio_wm1110
build_flags =
  ${wio_wm1110.build_flags}
  -D ADVERT_NAME='"WM1110 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 = ${wio_wm1110.build_src_filter}
  +<../examples/simple_room_server/*.cpp>

[env:wio_wm1110_companion_radio_ble]
extends = wio_wm1110
board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld
board_upload.maximum_size = 708608
build_flags =
  ${wio_wm1110.build_flags}
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D BLE_PIN_CODE=123456
  -D QSPIFLASH=1
  -D OFFLINE_QUEUE_SIZE=256
;  -D BLE_DEBUG_LOGGING=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${wio_wm1110.build_src_filter}
  +<helpers/nrf52/SerialBLEInterface.cpp>
  +<../examples/companion_radio/*.cpp>
lib_deps =
  ${wio_wm1110.lib_deps}
  densaugeo/base64 @ ~1.4.0
