[tlora_c6]
extends = esp32c6_base
board = esp32-c6-devkitm-1
board_build.partitions = min_spiffs.csv ; get around 4mb flash limit
build_flags =
  ${esp32c6_base.build_flags}
  -I variants/lilygo_tlora_c6
  -D ARDUINO_USB_CDC_ON_BOOT=1
  -D ARDUINO_USB_MODE=1
  -D P_LORA_TX_LED=7
  -D P_LORA_SCLK=6
  -D P_LORA_MISO=1
  -D P_LORA_MOSI=0
  -D P_LORA_NSS=18
  -D P_LORA_DIO_1=23
  -D P_LORA_BUSY=22
  -D P_LORA_RESET=21
  -D PIN_BOARD_SDA=8
  -D PIN_BOARD_SCL=9
  -D SX126X_RXEN=15
  -D SX126X_TXEN=14
  -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
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D DISABLE_WIFI_OTA=1
build_src_filter = ${esp32c6_base.build_src_filter}
  +<../variants/lilygo_tlora_c6>

[env:LilyGo_Tlora_C6_repeater_]
extends = tlora_c6
build_src_filter = ${tlora_c6.build_src_filter}
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${tlora_c6.build_flags}
  -D ADVERT_NAME='"Tlora C6 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
lib_deps =
  ${tlora_c6.lib_deps}
;  ${esp32_ota.lib_deps}

[env:LilyGo_Tlora_C6_room_server_]
extends = tlora_c6
build_src_filter = ${tlora_c6.build_src_filter}
  +<../examples/simple_room_server>
build_flags =
  ${tlora_c6.build_flags}
  -D ADVERT_NAME='"Tlora C6 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
lib_deps =
  ${tlora_c6.lib_deps}
;  ${esp32_ota.lib_deps}

[env:LilyGo_Tlora_C6_companion_radio_ble_]
extends = tlora_c6
build_flags = ${tlora_c6.build_flags}
  -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 ENABLE_PRIVATE_KEY_IMPORT=1
  -D ENABLE_PRIVATE_KEY_EXPORT=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${tlora_c6.build_src_filter}
  +<helpers/esp32/*.cpp>
  -<helpers/esp32/ESPNOWRadio.cpp>
  +<../examples/companion_radio/*.cpp>
lib_deps =
  ${tlora_c6.lib_deps}
  densaugeo/base64 @ ~1.4.0
