[Heltec_tracker_base]
extends = esp32_base
board = esp32-s3-devkitc-1
build_flags =
  ${esp32_base.build_flags}
  -I variants/heltec_tracker
  -D HELTEC_LORA_V3
  -D ARDUINO_USB_CDC_ON_BOOT=1      ; need for Serial
  -D ESP32_CPU_FREQ=80
  -D P_LORA_DIO_1=14
  -D P_LORA_NSS=8
  -D P_LORA_RESET=RADIOLIB_NC
  -D P_LORA_BUSY=13
  -D P_LORA_SCLK=9
  -D P_LORA_MISO=11
  -D P_LORA_MOSI=10
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D P_LORA_TX_LED=18
  -D PIN_BOARD_SDA=45
  -D PIN_BOARD_SCL=46
  -D PIN_USER_BTN=0
  -D PIN_ADC_CTRL=2
  -D PIN_TFT_SDA=42   ; SDIN
  -D PIN_TFT_SCL=41   ; SCLK
  -D PIN_TFT_DC=40    ; RS (register select)
  -D PIN_TFT_RST=39   ; RES
  -D PIN_TFT_CS=38
  -D USE_PIN_TFT=1
  -D PIN_VEXT_EN=3       ; Vext is connected to VDD which is also connected to OLED & GPS
  -D PIN_TFT_LEDA_CTL=21     ; LEDK (switches on/off via mosfet to create the ground)
  -D PIN_GPS_RX=33
  -D PIN_GPS_TX=34
  -D SX126X_DIO2_AS_RF_SWITCH=true
  -D SX126X_DIO3_TCXO_VOLTAGE=1.8
  -D SX126X_CURRENT_LIMIT=140
  -D SX126X_RX_BOOSTED_GAIN=1
build_src_filter = ${esp32_base.build_src_filter}
  +<../variants/heltec_tracker>
lib_deps =
  ${esp32_base.lib_deps}
  stevemarple/MicroNMEA @ ^2.0.6
  adafruit/Adafruit ST7735 and ST7789 Library @ ^1.11.0

[env:Heltec_Wireless_Tracker_companion_radio_ble]
extends = Heltec_tracker_base
build_flags =
  ${Heltec_tracker_base.build_flags}
  -I src/helpers/ui
  -I examples/companion_radio/ui-new
  -D DISPLAY_ROTATION=1
  -D DISPLAY_CLASS=ST7735Display
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D BLE_PIN_CODE=123456 ; HWT will use display for pin
  -D OFFLINE_QUEUE_SIZE=256
;  -D BLE_DEBUG_LOGGING=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Heltec_tracker_base.build_src_filter}
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
  +<helpers/ui/ST7735Display.cpp>
lib_deps =
  ${Heltec_tracker_base.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:Heltec_Wireless_Tracker_repeater]
extends = Heltec_tracker_base
build_flags =
  ${Heltec_tracker_base.build_flags}
  -D DISPLAY_ROTATION=1
  -D DISPLAY_CLASS=ST7735Display
  -D ADVERT_NAME='"Heltec 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 = ${Heltec_tracker_base.build_src_filter}
  +<helpers/ui/ST7735Display.cpp>
  +<../examples/simple_repeater>
lib_deps =
  ${Heltec_tracker_base.lib_deps}
  ${esp32_ota.lib_deps}

; [env:Heltec_Wireless_Tracker_repeater_bridge_rs232]
; extends = Heltec_tracker_base
; build_flags =
;   ${Heltec_tracker_base.build_flags}
;   -D DISPLAY_ROTATION=1
;   -D DISPLAY_CLASS=ST7735Display
;   -D ADVERT_NAME='"RS232 Bridge"'
;   -D ADVERT_LAT=0.0
;   -D ADVERT_LON=0.0
;   -D ADMIN_PASSWORD='"password"'
;   -D MAX_NEIGHBOURS=50
;   -D WITH_RS232_BRIDGE=Serial2
;   -D WITH_RS232_BRIDGE_RX=5
;   -D WITH_RS232_BRIDGE_TX=6
;  -D BRIDGE_DEBUG=1
; ;  -D MESH_PACKET_LOGGING=1
; ;  -D MESH_DEBUG=1
; build_src_filter = ${Heltec_tracker_base.build_src_filter}
;   +<helpers/bridges/RS232Bridge.cpp>
;   +<helpers/ui/ST7735Display.cpp>
;   +<../examples/simple_repeater>
; lib_deps =
;   ${Heltec_tracker_base.lib_deps}
;   ${esp32_ota.lib_deps}

[env:Heltec_Wireless_Tracker_repeater_bridge_espnow]
extends = Heltec_tracker_base
build_flags =
  ${Heltec_tracker_base.build_flags}
  -D DISPLAY_ROTATION=1
  -D DISPLAY_CLASS=ST7735Display
  -D ADVERT_NAME='"ESPNow Bridge"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
  -D WITH_ESPNOW_BRIDGE=1
;  -D BRIDGE_DEBUG=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Heltec_tracker_base.build_src_filter}
  +<helpers/bridges/ESPNowBridge.cpp>
  +<helpers/ui/ST7735Display.cpp>
  +<../examples/simple_repeater>
lib_deps =
  ${Heltec_tracker_base.lib_deps}
  ${esp32_ota.lib_deps}

[env:Heltec_Wireless_Tracker_room_server]
extends = Heltec_tracker_base
build_flags =
  ${Heltec_tracker_base.build_flags}
  -D DISPLAY_ROTATION=1
  -D DISPLAY_CLASS=ST7735Display
  -D ADVERT_NAME='"Heltec 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 = ${Heltec_tracker_base.build_src_filter}
  +<helpers/ui/ST7735Display.cpp>
  +<../examples/simple_room_server>
lib_deps =
  ${Heltec_tracker_base.lib_deps}
  ${esp32_ota.lib_deps}
