[Heltec_ct62]
extends = esp32_base
board = esp32-c3-devkitm-1
build_flags =
  ${esp32_base.build_flags}
  -I variants/heltec_ct62
  -D HELTEC_HT_CT62=1
  -D USE_SX1262
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D ESP32_CPU_FREQ=80
  -D LORA_TX_POWER=22
  -D P_LORA_TX_LED=18
  -D PIN_BOARD_SDA=0
  -D PIN_BOARD_SCL=1
  ;-D PIN_USER_BTN=9
  -D PIN_VBAT_READ=2
  -D P_LORA_DIO_1=3
  -D P_LORA_NSS=8
  -D P_LORA_RESET=5
  -D P_LORA_DIO_0=RADIOLIB_NC
  -D P_LORA_DIO_2=RADIOLIB_NC
  -D P_LORA_BUSY=4
  -D P_LORA_SCLK=10
  -D P_LORA_MISO=6
  -D P_LORA_MOSI=7
  -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_ct62>

[env:Heltec_ct62_repeater]
extends = Heltec_ct62
build_flags =
  ${Heltec_ct62.build_flags}
  ;-D ARDUINO_USB_MODE=1
  ;-D ARDUINO_USB_CDC_ON_BOOT=1
  -D ADVERT_NAME='"HT-CT62 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_ct62.build_src_filter}
  +<../examples/simple_repeater>
lib_deps =
  ${Heltec_ct62.lib_deps}
  ${esp32_ota.lib_deps}

; [env:Heltec_ct62_repeater_bridge_rs232]
; extends = Heltec_ct62
; build_flags =
;   ${Heltec_ct62.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 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_ct62.build_src_filter}
;   +<helpers/bridges/RS232Bridge.cpp>
;   +<../examples/simple_repeater>
; lib_deps =
;   ${Heltec_ct62.lib_deps}
;   ${esp32_ota.lib_deps}

[env:Heltec_ct62_repeater_bridge_espnow]
extends = Heltec_ct62
build_flags =
  ${Heltec_ct62.build_flags}
  -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_ct62.build_src_filter}
  +<helpers/bridges/ESPNowBridge.cpp>
  +<../examples/simple_repeater>
lib_deps =
  ${Heltec_ct62.lib_deps}
  ${esp32_ota.lib_deps}

[env:Heltec_ct62_companion_radio_usb]
extends = Heltec_ct62
build_flags =
  ${Heltec_ct62.build_flags}
;  -D ARDUINO_USB_MODE=1
;  -D ARDUINO_USB_CDC_ON_BOOT=1
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D OFFLINE_QUEUE_SIZE=256
  -D ENABLE_USB_INTERFACE
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Heltec_ct62.build_src_filter}
  +<../examples/companion_radio/*.cpp>
lib_deps =
  ${Heltec_ct62.lib_deps}
  ${esp32_ota.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:Heltec_ct62_companion_radio_ble]
extends = Heltec_ct62
build_flags =
  ${Heltec_ct62.build_flags}
;  -D ARDUINO_USB_MODE=1
;  -D ARDUINO_USB_CDC_ON_BOOT=1
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D OFFLINE_QUEUE_SIZE=256
  -D BLE_PIN_CODE=123456
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Heltec_ct62.build_src_filter}
  +<../examples/companion_radio/*.cpp>
  +<helpers/esp32/SerialBLEInterface.cpp>
lib_deps =
  ${Heltec_ct62.lib_deps}
  ${esp32_ota.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:Heltec_ct62_sensor]
extends = Heltec_ct62
build_flags =
  ${Heltec_ct62.build_flags}
  -D ADVERT_NAME='"HT-CT62 Sensor"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D PIN_BOARD_SDA=-1
  -D PIN_BOARD_SCL=-1
  -D PIN_BOARD_RELAY_CH1=0
  -D PIN_BOARD_RELAY_CH2=1
  -D PIN_BOARD_DIGITAL_IN=19
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Heltec_ct62.build_src_filter}
  +<../examples/simple_sensor>
lib_deps =
  ${Heltec_ct62.lib_deps}
  ${esp32_ota.lib_deps}

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