[Ebyte_EoRa-S3]
extends = esp32_base
board = ebyte_eora-s3
; Keep dual OTA slots and SPIFFS while avoiding the board definition's
; undersized 1.25 MiB default app partition.
board_build.partitions = min_spiffs.csv
build_flags =
  ${esp32_base.build_flags}
  -I variants/ebyte_eora_s3
  -D EBYTE_EORA_S3
  -D P_LORA_DIO_1=33
  -D P_LORA_NSS=7
  -D P_LORA_RESET=8   ; RADIOLIB_NC
  -D P_LORA_BUSY=34
  -D P_LORA_SCLK=5
  -D P_LORA_MISO=3
  -D P_LORA_MOSI=6
  -D P_LORA_TX_LED=37
  -D PIN_VBAT_READ=1
  -D PIN_USER_BTN=0
  -D PIN_BOARD_SDA=18
  -D PIN_BOARD_SCL=17

; SD_DAT0/MISO - GPIO2
; SD_DAT1 - GPIO4
; SD_CMD/MOSI - GPIO11
; SD_DAT2 - GPIO112
; SD_DAT3/CS - GPIO113
; SD_CLK - GPIO114
  -D PIN_BOARD_SDA=18
  -D PIN_BOARD_SCL=17

  -D SX126X_DIO2_AS_RF_SWITCH=true
  -D SX126X_DIO3_TCXO_VOLTAGE=1.8
  -D SX126X_CURRENT_LIMIT=140
  -D USE_SX1262
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D SX126X_RX_BOOSTED_GAIN=1
build_src_filter = ${esp32_base.build_src_filter}
  +<../variants/ebyte_eora_s3>
lib_deps =
  ${esp32_base.lib_deps}
  adafruit/Adafruit SSD1306 @ ^2.5.13

; === EByte EORA_S3 with SX1262 environments ===
[env:Ebyte_EoRa-S3_Repeater]
extends = Ebyte_EoRa-S3
build_flags =
  ${Ebyte_EoRa-S3.build_flags}
  -D DISPLAY_CLASS=SSD1306Display
  -D ADVERT_NAME='"EORA_S3-1262 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 = ${Ebyte_EoRa-S3.build_src_filter}
  +<helpers/ui/SSD1306Display.cpp>
  +<../examples/simple_repeater>
lib_deps =
  ${Ebyte_EoRa-S3.lib_deps}
  ${esp32_ota.lib_deps}

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

[env:Ebyte_EoRa-S3_room_server]
extends = Ebyte_EoRa-S3
build_flags =
  ${Ebyte_EoRa-S3.build_flags}
  -D DISPLAY_CLASS=SSD1306Display
  -D ADVERT_NAME='"EORA_S3-1262 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 = ${Ebyte_EoRa-S3.build_src_filter}
  +<helpers/ui/SSD1306Display.cpp>
  +<../examples/simple_room_server>
lib_deps =
  ${Ebyte_EoRa-S3.lib_deps}
  ${esp32_ota.lib_deps}

[env:Ebyte_EoRa-S3_companion_radio_usb]
extends = Ebyte_EoRa-S3
build_flags =
  ${Ebyte_EoRa-S3.build_flags}
  -I examples/companion_radio/ui-new
  -D DISPLAY_CLASS=SSD1306Display
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
; NOTE: DO NOT ENABLE -->  -D MESH_PACKET_LOGGING=1
; NOTE: DO NOT ENABLE -->  -D MESH_DEBUG=1
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Ebyte_EoRa-S3.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:Ebyte_EoRa-S3_companion_radio_ble]
extends = Ebyte_EoRa-S3
build_flags =
  ${Ebyte_EoRa-S3.build_flags}
  -I examples/companion_radio/ui-new
  -D DISPLAY_CLASS=SSD1306Display
  -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 MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
  +<helpers/esp32/*.cpp>
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Ebyte_EoRa-S3.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:Ebyte_EoRa-S3_kiss_modem]
extends = Ebyte_EoRa-S3
build_src_filter = ${Ebyte_EoRa-S3.build_src_filter}
  +<../examples/kiss_modem/>
