[ThinkNode_M2]
extends = esp32_base
board = ESP32-S3-WROOM-1-N4
build_flags = ${esp32_base.build_flags}
  -I variants/thinknode_m2
  -D THINKNODE_M2
  -D GPS_RX=44
  -D GPS_TX=43
  -D PIN_VEXT_EN=46
  -D PIN_BUZZER=5
  -D PIN_VEXT_EN_ACTIVE=HIGH
  -D PIN_BOARD_SCL=15
  -D PIN_BOARD_SDA=16
  -D P_LORA_DIO_1=3
  -D P_LORA_NSS=10
  -D P_LORA_RESET=21   ; RADIOLIB_NC
  -D P_LORA_BUSY=14   ;  DIO2 = 38
  -D P_LORA_SCLK=12
  -D P_LORA_MISO=13
  -D P_LORA_MOSI=11
  -D PIN_USER_BTN=47
  -D PIN_STATUS_LED=6
  -D PIN_LED=6
  -D SX126X_DIO2_AS_RF_SWITCH=true
  -D SX126X_DIO3_TCXO_VOLTAGE=3.3
  -D SX126X_CURRENT_LIMIT=140
  -D DISPLAY_CLASS=SH1106Display
  -D USE_SX1262
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D SX126X_RX_BOOSTED_GAIN=1
  -D MESH_DEBUG=1
build_src_filter = ${esp32_base.build_src_filter}
  +<helpers/ui/SH1106Display.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<helpers/ui/buzzer.cpp>
  +<../variants/thinknode_m2>
lib_deps = ${esp32_base.lib_deps}
  adafruit/Adafruit SH110X @ ~2.1.13
  adafruit/Adafruit GFX Library @ ^1.12.1

[env:ThinkNode_M2_Repeater]
extends = ThinkNode_M2
build_src_filter = ${ThinkNode_M2.build_src_filter}
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${ThinkNode_M2.build_flags}
  -D ADVERT_NAME='"Thinknode M2 Repeater"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=8
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps =
  ${ThinkNode_M2.lib_deps}
  ${esp32_ota.lib_deps}

; [env:ThinkNode_M2_Repeater_bridge_rs232]
; extends = ThinkNode_M2
; build_src_filter = ${ThinkNode_M2.build_src_filter}
;   +<helpers/bridges/RS232Bridge.cpp>
;   +<../examples/simple_repeater/*.cpp>
; build_flags =
;   ${ThinkNode_M2.build_flags}
;   -D ADVERT_NAME='"RS232 Bridge"'
;   -D ADVERT_LAT=0.0
;   -D ADVERT_LON=0.0
;   -D ADMIN_PASSWORD='"password"'
;   -D MAX_NEIGHBOURS=8
;   -D WITH_RS232_BRIDGE=Serial2
;   -D WITH_RS232_BRIDGE_RX=5
;   -D WITH_RS232_BRIDGE_TX=6
; ;  -D MESH_PACKET_LOGGING=1
; ;  -D MESH_DEBUG=1
; lib_deps =
;   ${ThinkNode_M2.lib_deps}
;   ${esp32_ota.lib_deps}

[env:ThinkNode_M2_Repeater_bridge_espnow]
extends = ThinkNode_M2
build_src_filter = ${ThinkNode_M2.build_src_filter}
  +<helpers/bridges/ESPNowBridge.cpp>
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${ThinkNode_M2.build_flags}
  -D ADVERT_NAME='"ESPNow Bridge"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=8
  -D WITH_ESPNOW_BRIDGE=1
  -D WITH_ESPNOW_BRIDGE_SECRET='"shared-secret"'
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps =
  ${ThinkNode_M2.lib_deps}
  ${esp32_ota.lib_deps}

[env:ThinkNode_M2_room_server]
extends = ThinkNode_M2
build_src_filter = ${ThinkNode_M2.build_src_filter}
  +<../examples/simple_room_server>
build_flags =
  ${ThinkNode_M2.build_flags}
  -D ADVERT_NAME='"Thinknode M2 Room Server"'
  -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
lib_deps =
  ${ThinkNode_M2.lib_deps}
  ${esp32_ota.lib_deps}

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

[env:ThinkNode_M2_companion_radio_ble]
extends = ThinkNode_M2
build_flags =
  ${ThinkNode_M2.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D BLE_PIN_CODE=123456
  -D OFFLINE_QUEUE_SIZE=256
;  -D BLE_DEBUG_LOGGING=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${ThinkNode_M2.build_src_filter}
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${ThinkNode_M2.lib_deps}
  densaugeo/base64 @ ~1.4.0
  end2endzone/NonBlockingRTTTL@^1.3.0

[env:ThinkNode_M2_companion_radio_usb]
extends = ThinkNode_M2
build_flags =
  ${ThinkNode_M2.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D OFFLINE_QUEUE_SIZE=256
build_src_filter = ${ThinkNode_M2.build_src_filter}
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${ThinkNode_M2.lib_deps}
  densaugeo/base64 @ ~1.4.0
  end2endzone/NonBlockingRTTTL@^1.3.0

[env:ThinkNode_M2_companion_radio_wifi]
extends = ThinkNode_M2
build_flags =
  ${ThinkNode_M2.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D OFFLINE_QUEUE_SIZE=256
  -D WIFI_DEBUG_LOGGING=1
  -D WIFI_SSID='"myssid"'
  -D WIFI_PWD='"mypwd"'
build_src_filter = ${ThinkNode_M2.build_src_filter}
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${ThinkNode_M2.lib_deps}
  densaugeo/base64 @ ~1.4.0
  end2endzone/NonBlockingRTTTL@^1.3.0

[env:ThinkNode_M2_companion_radio_serial]
extends = ThinkNode_M2
build_flags =
  ${ThinkNode_M2.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D SERIAL_TX=D6
  -D SERIAL_RX=D7
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${ThinkNode_M2.build_src_filter}
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${ThinkNode_M2.lib_deps}
  densaugeo/base64 @ ~1.4.0
