This commit is contained in:
Alexander Begoon 2025-06-07 17:53:06 +02:00 committed by GitHub
commit 6bfae08965
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
42 changed files with 279 additions and 66 deletions

View File

@ -1,6 +1,7 @@
## 🙏 Thank you for sending in a pull request, here's some tips to get started!
### ❌ (Please delete all these tips and replace them with your text) ❌
- Before starting on some new big chunk of code, it it is optional but highly recommended to open an issue first
to say "Hey, I think this idea X should be implemented and I'm starting work on it. My general plan is Y, any feedback
is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc...
@ -15,8 +16,8 @@
- If you do not have the affected hardware to test your code changes adequately against regressions, please indicate this, so that contributors and commnunity members can help test your changes.
- If your PR gets accepted you can request a "Contributor" role in the Meshtastic Discord
## 🤝 Attestations
- [ ] I have tested that my proposed changes behave as described.
- [ ] I have tested that my proposed changes do not cause any obvious regressions on the following devices:
- [ ] Heltec (Lora32) V3

8
.gitignore vendored
View File

@ -38,3 +38,11 @@ release/
/compile_commands.json
src/mesh/raspihttp/certificate.pem
src/mesh/raspihttp/private_key.pem
managed_components
dependencies.lock
log_*
sdkconfig
sdkconfig.*
!sdkconfig.defaults

6
CMakeLists.txt Normal file
View File

@ -0,0 +1,6 @@
# This file supports the ESP-IDF framework only.
# Specifically, it targets the ESP32-C6 due to limited support in PlatformIO (see: https://github.com/platformio/platform-espressif32/issues/1225).
# Currently, we need to compile NimBLE CPP manually to enable BLE, and possibly WiFi, for ESP32-C6 targets.
cmake_minimum_required(VERSION 3.16.0)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(firmware)

View File

@ -17,9 +17,7 @@ build_flags =
-DMESHTASTIC_EXCLUDE_WEBSERVER
;-DDEBUG_HEAP
; TEMP
-DHAS_BLUETOOTH=0
-DMESHTASTIC_EXCLUDE_PAXCOUNTER
-DMESHTASTIC_EXCLUDE_BLUETOOTH
lib_deps =
${arduino_base.lib_deps}
@ -32,7 +30,9 @@ lib_deps =
# renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
rweather/Crypto@0.4.0
rweather/Crypto@^0.4.0
# renovate: datasource=github-tags depName=esp-nimble-cpp packageName=h2zero/esp-nimble-cpp
https://github.com/h2zero/esp-nimble-cpp/archive/2.2.1.zip
build_src_filter =
${esp32_base.build_src_filter} -<mesh/http>

View File

@ -86,11 +86,20 @@ if platform.name == "nordicnrf52":
env.VerboseAction(f"\"{sys.executable}\" ./bin/uf2conv.py $BUILD_DIR/firmware.hex -c -f 0xADA52840 -o $BUILD_DIR/firmware.uf2",
"Generating UF2 file"))
Import("projenv")
verPropFile = "version.properties"
try:
# See: https://github.com/platformio/platform-espressif32/issues/953
Import("projenv")
prefsLoc = projenv["PROJECT_DIR"] + "/" + verPropFile
except Exception as e:
print(f"Warning: Unable to import 'projenv'. Falling back. Error: {e}")
projenv = None
prefsLoc = "./" + verPropFile # Fallback location
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
verObj = readProps(prefsLoc)
print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"] + " on " + env.get("PIOENV"))
appEnv = env.get("PIOENV")
jsonLoc = env["PROJECT_DIR"] + "/userPrefs.jsonc"
with open(jsonLoc) as f:
@ -123,9 +132,10 @@ print ("Using flags:")
for flag in flags:
print(flag)
projenv.Append(
CCFLAGS=flags,
)
if projenv:
projenv.Append(CCFLAGS=flags)
env.Append(CCFLAGS=flags)
for lb in env.GetLibBuilders():
if lb.name == "meshtastic-device-ui":

View File

@ -7,9 +7,7 @@
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_MDBT50Q_RX -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
["0x2886", "0x0166"]
],
"hwids": [["0x2886", "0x0166"]],
"usb_product": "XIAO-BOOT",
"mcu": "nrf52840",
"variant": "seeed_xiao_nrf52840_kit",

37
sdkconfig.defaults Normal file
View File

@ -0,0 +1,37 @@
# # This file configures the ESP-IDF framework for the ESP32 platform.
# It enables BLE functionality using NimBLE and optimizes for minimal power consumption and size.
# Refer to the ESP-IDF Kconfig documentation for more details: https://docs.espressif.com/projects/esp-idf/en/v5.1.6/esp32c6/api-reference/kconfig.html
# CONFIG_AUTOSTART_ARDUINO is not set
# CONFIG_WS2812_LED_ENABLE is not set
CONFIG_FREERTOS_HZ=1000
CONFIG_MBEDTLS_PSK_MODES=y
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y
# Override some defaults so BT stack is enabled
# in this example
#
# BT config
#
CONFIG_BT_ENABLED=y
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n
CONFIG_BTDM_CTRL_MODE_BTDM=n
CONFIG_BT_BLUEDROID_ENABLED=n
CONFIG_BT_NIMBLE_ENABLED=y
#
# Arduino Configuration
#
#
# Disable all Arduino included BLE libraries
#
CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
# CONFIG_ARDUINO_SELECTIVE_WiFiProv is not set
# CONFIG_ARDUINO_SELECTIVE_BLE is not set
# CONFIG_ARDUINO_SELECTIVE_BluetoothSerial is not set
# CONFIG_ARDUINO_SELECTIVE_SimpleBLE is not set
# end of Arduino Configuration

14
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,14 @@
# This file supports the ESP-IDF framework only.
# Specifically, it targets the ESP32-C6 due to limited support in PlatformIO (see: https://github.com/platformio/platform-espressif32/issues/1225).
# Currently, we need to compile NimBLE CPP manually to enable BLE, and possibly WiFi, for ESP32-C6 targets.
FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*)
FILE(GLOB_RECURSE platform_sources ${CMAKE_SOURCE_DIR}/src/platform/**/*.*)
list(REMOVE_ITEM app_sources ${platform_sources})
FILE(GLOB_RECURSE esp32_sources ${CMAKE_SOURCE_DIR}/src/platform/esp32/*.*)
list(APPEND app_sources ${esp32_sources})
FILE(GLOB_RECURSE esp32_sources ${CMAKE_SOURCE_DIR}/src/platform/esp32/**/*.*)
list(APPEND app_sources ${esp32_sources})
list(REMOVE_ITEM app_sources ${CMAKE_SOURCE_DIR}/src/mesh/eth/ethClient.cpp)
# Register the component with ESP-IDF
idf_component_register(SRCS ${app_sources} INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src)

View File

@ -1,8 +1,8 @@
#include "RedirectablePrint.h"
#include "NodeDB.h"
#include "RTC.h"
#include "concurrency/OSThread.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh/generated/meshtastic/mesh.pb.h"
#include <assert.h>

View File

@ -9,10 +9,10 @@
#include "GpioLogic.h"
#include "NodeDB.h"
#include "PowerMon.h"
#include "RTC.h"
#include "Throttle.h"
#include "buzz.h"
#include "concurrency/Periodic.h"
#include "gps/RTC.h"
#include "meshUtils.h"
#include "main.h" // pmu_found

View File

@ -1,7 +1,7 @@
#if !MESHTASTIC_EXCLUDE_GPS
#include "NMEAWPL.h"
#include "GeoCoord.h"
#include "RTC.h"
#include "gps/RTC.h"
#include <time.h>
/* -------------------------------------------

View File

@ -1,4 +1,4 @@
#include "RTC.h"
#include "gps/RTC.h"
#include "configuration.h"
#include "detect/ScanI2C.h"
#include "main.h"

View File

@ -13,13 +13,13 @@
#include "FSCommon.h"
#include "Led.h"
#include "RTC.h"
#include "SPILock.h"
#include "Throttle.h"
#include "concurrency/OSThread.h"
#include "concurrency/Periodic.h"
#include "detect/ScanI2C.h"
#include "error.h"
#include "gps/RTC.h"
#include "power.h"
#if !MESHTASTIC_EXCLUDE_I2C
@ -1403,3 +1403,15 @@ void loop()
}
}
#endif
#if !defined(CONFIG_AUTOSTART_ARDUINO) && (ESP_IDF_VERSION_MAJOR * 100 + ESP_IDF_VERSION_MINOR * 10 + ESP_IDF_VERSION_PATCH) > 512
// Define app_main to bridge Arduino and ESP-IDF
extern "C" void app_main(void)
{
setup();
while (1) {
loop();
vTaskDelay(1); // Allows FreeRTOS to manage tasks
}
}
#endif

View File

@ -9,8 +9,8 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "TypeConversions.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh-pb-constants.h"
#include "meshUtils.h"

View File

@ -11,12 +11,12 @@
#include "NodeDB.h"
#include "PacketHistory.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "SPILock.h"
#include "SafeFile.h"
#include "TypeConversions.h"
#include "error.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh-pb-constants.h"
#include "meshUtils.h"

View File

@ -29,7 +29,7 @@
#include "mqtt/MQTT.h"
#endif
#include "Throttle.h"
#include <RTC.h>
#include "gps/RTC.h"
PhoneAPI::PhoneAPI()
{

View File

@ -4,9 +4,9 @@
#include "MeshRadio.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "configuration.h"
#include "detect/LoRaRadioType.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh-pb-constants.h"
#include "meshUtils.h"

View File

@ -1,8 +1,8 @@
#include "StreamAPI.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Throttle.h"
#include "configuration.h"
#include "gps/RTC.h"
#define START1 0x94
#define START2 0xc3

View File

@ -1,8 +1,8 @@
#include "mesh/eth/ethClient.h"
#include "NodeDB.h"
#include "RTC.h"
#include "concurrency/Periodic.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh/api/ethServerAPI.h"
#include "target_specific.h"

View File

@ -1,8 +1,8 @@
#include "configuration.h"
#if HAS_WIFI
#include "NodeDB.h"
#include "RTC.h"
#include "concurrency/Periodic.h"
#include "gps/RTC.h"
#include "mesh/wifi/WiFiAPClient.h"
#include "main.h"

View File

@ -3,8 +3,8 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "SPILock.h"
#include "gps/RTC.h"
#include "meshUtils.h"
#include <FSCommon.h>
#if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_BLUETOOTH

View File

@ -16,10 +16,10 @@
#include "ExternalNotificationModule.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "buzz/buzz.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh/generated/meshtastic/rtttl.pb.h"
#include <Arduino.h>

View File

@ -2,7 +2,7 @@
#include "Default.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "gps/RTC.h"
#include <Throttle.h>
NeighborInfoModule *neighborInfoModule;

View File

@ -2,9 +2,9 @@
#include "Default.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include <Throttle.h>

View File

@ -4,12 +4,12 @@
#include "GPS.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "TypeConversions.h"
#include "airtime.h"
#include "configuration.h"
#include "gps/GeoCoord.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh/compression/unishox2.h"
#include "meshUtils.h"

View File

@ -3,9 +3,9 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerMon.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "sleep.h"
#include "target_specific.h"

View File

@ -13,12 +13,12 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "SPILock.h"
#include "airtime.h"
#include "configuration.h"
#include "gps/GeoCoord.h"
#include "gps/RTC.h"
#include <Arduino.h>
#include <Throttle.h>

View File

@ -1,9 +1,9 @@
#include "RemoteHardwareModule.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include <Throttle.h>

View File

@ -3,9 +3,9 @@
#include "MeshService.h"
#include "NMEAWPL.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
#include "gps/RTC.h"
#include <Arduino.h>
#include <Throttle.h>

View File

@ -15,11 +15,11 @@
#include "StoreForwardModule.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "Throttle.h"
#include "airtime.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "memGet.h"
#include "mesh-pb-constants.h"
#include "mesh/generated/meshtastic/storeforward.pb.h"

View File

@ -8,9 +8,9 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "detect/ScanI2CTwoWire.h"
#include "gps/RTC.h"
#include "main.h"
#include <Throttle.h>

View File

@ -4,10 +4,10 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "RadioLibInterface.h"
#include "Router.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "memGet.h"
#include <OLEDDisplay.h>

View File

@ -8,9 +8,9 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "UnitConversions.h"
#include "gps/RTC.h"
#include "main.h"
#include "power.h"
#include "sleep.h"

View File

@ -8,9 +8,9 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "UnitConversions.h"
#include "gps/RTC.h"
#include "main.h"
#include "power.h"
#include "sleep.h"

View File

@ -8,8 +8,8 @@
#include "NodeDB.h"
#include "PowerFSM.h"
#include "PowerTelemetry.h"
#include "RTC.h"
#include "Router.h"
#include "gps/RTC.h"
#include "main.h"
#include "power.h"
#include "sleep.h"

View File

@ -4,8 +4,8 @@
#include "FSCommon.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "gps/RTC.h"
/*
AudioModule

View File

@ -49,8 +49,12 @@ static uint8_t lastToRadio[MAX_TO_FROM_RADIO_SIZE];
class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks
{
#ifdef CONFIG_NIMBLE_CPP_IDF
virtual void onWrite(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo){
#else
virtual void onWrite(NimBLECharacteristic *pCharacteristic)
{
#endif
LOG_DEBUG("To Radio onwrite");
auto val = pCharacteristic->getValue();
@ -62,12 +66,17 @@ class NimbleBluetoothToRadioCallback : public NimBLECharacteristicCallbacks
LOG_DEBUG("Drop dup ToRadio packet we just saw");
}
}
};
}
;
class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
{
#ifdef CONFIG_NIMBLE_CPP_IDF
virtual void onRead(NimBLECharacteristic *pCharacteristic, NimBLEConnInfo &connInfo){
#else
virtual void onRead(NimBLECharacteristic *pCharacteristic)
{
#endif
uint8_t fromRadioBytes[meshtastic_FromRadio_size];
size_t numBytes = bluetoothPhoneAPI->getFromRadio(fromRadioBytes);
@ -75,12 +84,18 @@ class NimbleBluetoothFromRadioCallback : public NimBLECharacteristicCallbacks
pCharacteristic->setValue(fromRadioByteString);
}
};
}
;
class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
{
#ifdef CONFIG_NIMBLE_CPP_IDF
virtual uint32_t onPassKeyDisplay()
{
#else
virtual uint32_t onPassKeyRequest()
{
#endif
uint32_t passkey = config.bluetooth.fixed_pin;
if (config.bluetooth.mode == meshtastic_Config_BluetoothConfig_PairingMode_RANDOM_PIN) {
@ -124,9 +139,13 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
return passkey;
}
#ifdef CONFIG_NIMBLE_CPP_IDF
virtual void onAuthenticationComplete(NimBLEConnInfo &connInfo)
{
#else
virtual void onAuthenticationComplete(ble_gap_conn_desc *desc)
{
#endif
LOG_INFO("BLE authentication complete");
bluetoothStatus->updateStatus(new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::CONNECTED));
@ -138,10 +157,15 @@ class NimbleBluetoothServerCallback : public NimBLEServerCallbacks
}
}
#ifdef CONFIG_NIMBLE_CPP_IDF
virtual void onDisconnect(NimBLEServer *pServer, NimBLEConnInfo &connInfo, int reason)
{
LOG_INFO("BLE disconnect. Reason: %i", reason);
#else
virtual void onDisconnect(NimBLEServer *pServer, ble_gap_conn_desc *desc)
{
LOG_INFO("BLE disconnect");
#endif
bluetoothStatus->updateStatus(
new meshtastic::BluetoothStatus(meshtastic::BluetoothStatus::ConnectionState::DISCONNECTED));
@ -191,7 +215,11 @@ int NimbleBluetooth::getRssi()
if (bleServer && isConnected()) {
auto service = bleServer->getServiceByUUID(MESH_SERVICE_UUID);
uint16_t handle = service->getHandle();
#ifdef CONFIG_NIMBLE_CPP_IDF
return NimBLEDevice::getClientByHandle(handle)->getRssi();
#else
return NimBLEDevice::getClientByID(handle)->getRssi();
#endif
}
return 0; // FIXME figure out where to source this
}
@ -216,6 +244,9 @@ void NimbleBluetooth::setup()
NimbleBluetoothServerCallback *serverCallbacks = new NimbleBluetoothServerCallback();
bleServer->setCallbacks(serverCallbacks, true);
#ifdef CONFIG_NIMBLE_CPP_IDF
bleServer->advertiseOnDisconnect(true);
#endif
setupService();
startAdvertising();
}
@ -259,7 +290,11 @@ void NimbleBluetooth::setupService()
BatteryCharacteristic = batteryService->createCharacteristic( // 0x2A19 is the Battery Level characteristic)
(uint16_t)0x2a19, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY, 1);
#ifdef CONFIG_NIMBLE_CPP_IDF
NimBLE2904 *batteryLevelDescriptor = (NimBLE2904 *)BatteryCharacteristic->create2904();
#else
NimBLE2904 *batteryLevelDescriptor = (NimBLE2904 *)BatteryCharacteristic->createDescriptor((uint16_t)0x2904);
#endif
batteryLevelDescriptor->setFormat(NimBLE2904::FORMAT_UINT8);
batteryLevelDescriptor->setNamespace(1);
batteryLevelDescriptor->setUnit(0x27ad);

View File

@ -117,9 +117,14 @@ void esp32Setup()
LOG_DEBUG("Free heap: %d", ESP.getFreeHeap());
LOG_DEBUG("Total PSRAM: %d", ESP.getPsramSize());
LOG_DEBUG("Free PSRAM: %d", ESP.getFreePsram());
esp_log_level_set("gpio", ESP_LOG_WARN);
auto res = nvs_flash_init();
assert(res == ESP_OK);
nvs_stats_t nvs_stats;
auto res = nvs_get_stats(NULL, &nvs_stats);
res = nvs_get_stats(NULL, &nvs_stats);
assert(res == ESP_OK);
LOG_DEBUG("NVS: UsedEntries %d, FreeEntries %d, AllEntries %d, NameSpaces %d", nvs_stats.used_entries, nvs_stats.free_entries,
nvs_stats.total_entries, nvs_stats.namespace_count);
@ -170,8 +175,9 @@ void esp32Setup()
#ifdef CONFIG_IDF_TARGET_ESP32C6
esp_task_wdt_config_t *wdt_config = (esp_task_wdt_config_t *)malloc(sizeof(esp_task_wdt_config_t));
wdt_config->timeout_ms = APP_WATCHDOG_SECS * 1000;
wdt_config->idle_core_mask = 0;
wdt_config->trigger_panic = true;
res = esp_task_wdt_init(wdt_config);
res = esp_task_wdt_reconfigure(wdt_config);
assert(res == ESP_OK);
#else
res = esp_task_wdt_init(APP_WATCHDOG_SECS, true);
@ -183,6 +189,17 @@ void esp32Setup()
#ifdef HAS_32768HZ
enableSlowCLK();
#endif
#ifdef USE_XIAO_ESP32C6_EXTERNAL_ANTENNA
#warning "Connect an external antenna to your XIAO ESP32C6; otherwise, it may be damaged!"
gpio_reset_pin(GPIO_NUM_3);
gpio_set_direction(GPIO_NUM_3, GPIO_MODE_OUTPUT);
gpio_set_level(GPIO_NUM_3, LOW);
gpio_reset_pin(GPIO_NUM_14);
gpio_set_direction(GPIO_NUM_14, GPIO_MODE_OUTPUT);
gpio_set_level(GPIO_NUM_14, HIGH);
#endif
}
/// loop code specific to ESP32 targets

View File

@ -1,5 +1,5 @@
#include "RTC.h"
#include "configuration.h"
#include "gps/RTC.h"
#include <stm32wle5xx.h>
#include <stm32wlxx_hal.h>

View File

@ -0,0 +1,20 @@
[env:seeed-xiao-esp32c6]
extends = esp32c6_base
framework = arduino, espidf
board = esp32-c6-devkitm-1
board_check = true
board_build.partitions = partition-table.csv
upload_protocol = esptool
upload_speed = 921600
extra_scripts = pre:bin/platformio-custom.py
build_flags =
${esp32c6_base.build_flags}
-D PRIVATE_HW
-I variants/seeed_xiao_esp32c6
-D ARDUINO_USB_CDC_ON_BOOT=1
-D ARDUINO_USB_MODE=1
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/esp32c3"
-D HAS_BLUETOOTH=1
-D MESHTASTIC_EXCLUDE_WEBSERVER
-D MESHTASTIC_EXCLUDE_MQTT
-D CONFIG_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT=1

View File

@ -0,0 +1,44 @@
#define LED_PIN 15
#define LED_STATE_ON 0 // State when LED is lit
#define BUTTON_PIN 21 // This is the Program Button
#define BUTTON_NEED_PULLUP
#define I2C_SDA 22
#define I2C_SCL 23
// #define USE_RF95
#define USE_SX1262
#define LORA_MISO 20
#define LORA_SCK 19
#define LORA_MOSI 18
#ifdef USE_RF95
#define LORA_CS 17
#define LORA_RESET 1
#define LORA_DIO0 0
#define LORA_DIO1 16
#endif
#ifdef USE_SX1262
#define LORA_CS 21
#define LORA_DIO1 2
#define LORA_BUSY 0
#define LORA_RESET 5
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_BUSY
#define SX126X_RESET LORA_RESET
#define SX126X_RXEN 4
#define SX126X_TXEN RADIOLIB_NC
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#endif
#define HAS_GPS 0
#undef GPS_RX_PIN
#undef GPS_TX_PIN
// For BLE/WiFi connectivity
#define USE_XIAO_ESP32C6_EXTERNAL_ANTENNA

View File

@ -1,9 +1,20 @@
[env:tlora-c6]
extends = esp32c6_base
framework = arduino, espidf
board = esp32-c6-devkitm-1
board_check = true
board_build.partitions = partition-table.csv
upload_protocol = esptool
upload_speed = 921600
extra_scripts = pre:bin/platformio-custom.py
build_flags =
${esp32c6_base.build_flags}
-D TLORA_C6
-I variants/tlora_c6
-D ARDUINO_USB_CDC_ON_BOOT=1
-D ARDUINO_USB_MODE=1
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/esp32c3"
-D HAS_BLUETOOTH=1
-D MESHTASTIC_EXCLUDE_WEBSERVER
-D MESHTASTIC_EXCLUDE_MQTT
-D CONFIG_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT=1