mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 11:59:12 +03:00
add board ESP32-C6 4mb and 8mb
This commit is contained in:
@@ -52,8 +52,16 @@
|
|||||||
#define FIRMWARE_NAME "esp32s3_16mb"
|
#define FIRMWARE_NAME "esp32s3_16mb"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LIBRETINY
|
#ifdef bk7231n
|
||||||
#define FIRMWARE_NAME "libretiny"
|
#define FIRMWARE_NAME "bk7231n"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef esp32c6_4mb
|
||||||
|
#define FIRMWARE_NAME "esp32c6_4mb"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef esp32c6_8mb
|
||||||
|
#define FIRMWARE_NAME "esp32c6_8mb"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Размер буфера json
|
// Размер буфера json
|
||||||
|
|||||||
@@ -6,9 +6,10 @@
|
|||||||
// xtensa-esp32-elf-addr2line.exe -pfiaC -e Путь_к_файлу/firmware.elf Стэк_адресов_из_сообщения
|
// xtensa-esp32-elf-addr2line.exe -pfiaC -e Путь_к_файлу/firmware.elf Стэк_адресов_из_сообщения
|
||||||
// %%USERPROFILE%/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/bin xtensa-esp32-elf-addr2line.exe -pfiaC -e .pio/build/esp32_4mb3f/firmware.elf Стэк_адресов
|
// %%USERPROFILE%/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/bin xtensa-esp32-elf-addr2line.exe -pfiaC -e .pio/build/esp32_4mb3f/firmware.elf Стэк_адресов
|
||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
|
#if defined(ESP32) && !defined(esp32c3m_4mb) && !defined(esp32c6_4mb) && !defined(esp32c6_8mb)
|
||||||
#define RESTART_DEBUG_INFO
|
#define RESTART_DEBUG_INFO
|
||||||
#if defined(RESTART_DEBUG_INFO) && defined(ESP32) && !defined(esp32c3m_4mb)
|
#endif
|
||||||
|
#if defined(RESTART_DEBUG_INFO)
|
||||||
#define CONFIG_RESTART_DEBUG_STACK_DEPTH 15
|
#define CONFIG_RESTART_DEBUG_STACK_DEPTH 15
|
||||||
typedef struct {
|
typedef struct {
|
||||||
size_t heap_total;
|
size_t heap_total;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"projectProp": {
|
"projectProp": {
|
||||||
"platformio": {
|
"platformio": {
|
||||||
"default_envs": "esp32_4mb3f",
|
"default_envs": "esp32_4mb3f",
|
||||||
"comments_default_envs": "choose from: esp8266_4mb, esp32_4mb, esp32_4mb3f, esp8266_16mb, esp32_16mb, esp32cam_4mb, esp32s2_4mb, esp32s3_16mb, esp32c3m_4mb, esp8266_1mb, esp8266_1mb_ota, esp8266_2mb, esp8266_2mb_ota, esp8285_1mb, esp8285_1mb_ota",
|
"comments_default_envs": "choose from: esp8266_4mb, esp32_4mb, esp32_4mb3f, esp8266_16mb, esp32_16mb, esp32cam_4mb, esp32s2_4mb, esp32s3_16mb, esp32c3m_4mb, esp8266_1mb, esp8266_1mb_ota, esp8266_2mb, esp8266_2mb_ota, esp8285_1mb, esp8285_1mb_ota, esp32c6_4mb, esp32c6_8mb, bk7231n",
|
||||||
"envs": [
|
"envs": [
|
||||||
{
|
{
|
||||||
"name": "esp8266_4mb",
|
"name": "esp8266_4mb",
|
||||||
@@ -123,6 +123,22 @@
|
|||||||
"firmware": "0x10000",
|
"firmware": "0x10000",
|
||||||
"partitions": "0x8000",
|
"partitions": "0x8000",
|
||||||
"littlefs": "0x910000"
|
"littlefs": "0x910000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "esp32c6_4mb",
|
||||||
|
"boot_app0": "0xe000",
|
||||||
|
"bootloader_qio_80m": "0x1000",
|
||||||
|
"firmware": "0x10000",
|
||||||
|
"partitions": "0x8000",
|
||||||
|
"littlefs": "0x310000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "esp32c6_8mb",
|
||||||
|
"boot_app0": "0xe000",
|
||||||
|
"bootloader_qio_80m": "0x1000",
|
||||||
|
"firmware": "0x10000",
|
||||||
|
"partitions": "0x8000",
|
||||||
|
"littlefs": "0x670000"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
179
platformio.ini
179
platformio.ini
@@ -381,6 +381,65 @@ build_src_filter =
|
|||||||
+<modules/*.cpp>
|
+<modules/*.cpp>
|
||||||
${env:esp32_16mb_fromitems.build_src_filter}
|
${env:esp32_16mb_fromitems.build_src_filter}
|
||||||
|
|
||||||
|
[env:esp32c6_4mb]
|
||||||
|
extra_scripts = pre:tools/patch32c6.py
|
||||||
|
lib_deps =
|
||||||
|
${common_env_data.lib_deps_external}
|
||||||
|
${env:esp32c6_4mb_fromitems.lib_deps}
|
||||||
|
lib_ignore = LT_WebSockets
|
||||||
|
build_flags =
|
||||||
|
-Desp32c6_4mb="esp32c6_4mb"
|
||||||
|
-DARDUINO_USB_CDC_ON_BOOT=0
|
||||||
|
-DARDUINO_USB_MODE=0
|
||||||
|
-Wl,--wrap=esp_panic_handler
|
||||||
|
framework = arduino
|
||||||
|
board = esp32-c6-devkitm-1
|
||||||
|
platform = espressif32 @6.9.0
|
||||||
|
platform_packages =
|
||||||
|
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
|
||||||
|
platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
|
||||||
|
monitor_filters = esp32_exception_decoder
|
||||||
|
upload_speed = 921600
|
||||||
|
monitor_speed = 115200
|
||||||
|
debug_tool = esp-prog
|
||||||
|
board_build.partitions = tools/partitions_custom.csv
|
||||||
|
board_build.filesystem = littlefs
|
||||||
|
build_src_filter =
|
||||||
|
+<*.cpp>
|
||||||
|
+<classes/*.cpp>
|
||||||
|
+<utils/*.cpp>
|
||||||
|
+<modules/*.cpp>
|
||||||
|
${env:esp32c6_4mb_fromitems.build_src_filter}
|
||||||
|
|
||||||
|
[env:esp32c6_8mb]
|
||||||
|
extra_scripts = pre:tools/patch32c6.py
|
||||||
|
lib_deps =
|
||||||
|
${common_env_data.lib_deps_external}
|
||||||
|
${env:esp32c6_8mb_fromitems.lib_deps}
|
||||||
|
lib_ignore = LT_WebSockets
|
||||||
|
build_flags =
|
||||||
|
-Desp32c6_4mb="esp32c6_4mb"
|
||||||
|
-DARDUINO_USB_CDC_ON_BOOT=0
|
||||||
|
-DARDUINO_USB_MODE=0
|
||||||
|
-Wl,--wrap=esp_panic_handler
|
||||||
|
framework = arduino
|
||||||
|
board = esp32-c6-devkitc-1
|
||||||
|
platform = espressif32 @6.9.0
|
||||||
|
platform_packages =
|
||||||
|
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
|
||||||
|
platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
|
||||||
|
monitor_filters = esp32_exception_decoder
|
||||||
|
upload_speed = 921600
|
||||||
|
monitor_speed = 115200
|
||||||
|
debug_tool = esp-prog
|
||||||
|
board_build.filesystem = littlefs
|
||||||
|
build_src_filter =
|
||||||
|
+<*.cpp>
|
||||||
|
+<classes/*.cpp>
|
||||||
|
+<utils/*.cpp>
|
||||||
|
+<modules/*.cpp>
|
||||||
|
${env:esp32c6_8mb_fromitems.build_src_filter}
|
||||||
|
|
||||||
[env:bk7231n]
|
[env:bk7231n]
|
||||||
extra_scripts = pre:tools/lt_fsbuildscript.py
|
extra_scripts = pre:tools/lt_fsbuildscript.py
|
||||||
lib_compat_mode = off
|
lib_compat_mode = off
|
||||||
@@ -882,6 +941,126 @@ build_src_filter =
|
|||||||
+<modules/virtual/VariableColor>
|
+<modules/virtual/VariableColor>
|
||||||
+<modules/virtual/VButton>
|
+<modules/virtual/VButton>
|
||||||
|
|
||||||
|
[env:esp32c6_4mb_fromitems]
|
||||||
|
lib_deps =
|
||||||
|
https://github.com/enjoyneering/AHTxx.git
|
||||||
|
adafruit/Adafruit BME280 Library
|
||||||
|
adafruit/Adafruit BMP280 Library
|
||||||
|
beegee-tokyo/DHT sensor library for ESPx
|
||||||
|
https://github.com/pstolarz/Arduino-Temperature-Control-Library.git#OneWireNg
|
||||||
|
robtillaart/SHT2x@^0.1.1
|
||||||
|
WEMOS SHT3x@1.0.0
|
||||||
|
plerup/EspSoftwareSerial
|
||||||
|
gyverlibs/EncButton @ ^2.0
|
||||||
|
https://github.com/RoboticsBrno/ServoESP32#v1.0.3
|
||||||
|
adafruit/Adafruit MCP23017 Arduino Library@^2.1.0
|
||||||
|
adafruit/Adafruit BusIO @ ^1.13.2
|
||||||
|
adafruit/Adafruit BusIO @ ^1.13.2
|
||||||
|
https://github.com/robotclass/RobotClass_LiquidCrystal_I2C
|
||||||
|
marcoschwartz/LiquidCrystal_I2C@^1.1.4
|
||||||
|
https://github.com/stblassitude/Adafruit_SSD1306_Wemos_OLED
|
||||||
|
https://github.com/adafruit/Adafruit-GFX-Library
|
||||||
|
build_src_filter =
|
||||||
|
+<modules/virtual/Cron>
|
||||||
|
+<modules/virtual/Loging>
|
||||||
|
+<modules/virtual/LogingDaily>
|
||||||
|
+<modules/virtual/Math>
|
||||||
|
+<modules/virtual/owmWeather>
|
||||||
|
+<modules/virtual/Ping>
|
||||||
|
+<modules/virtual/Timer>
|
||||||
|
+<modules/virtual/Variable>
|
||||||
|
+<modules/virtual/VButton>
|
||||||
|
+<modules/sensors/A02Distance>
|
||||||
|
+<modules/sensors/Acs712>
|
||||||
|
+<modules/sensors/AhtXX>
|
||||||
|
+<modules/sensors/AnalogAdc>
|
||||||
|
+<modules/sensors/BL0937>
|
||||||
|
+<modules/sensors/Bme280>
|
||||||
|
+<modules/sensors/Bmp280>
|
||||||
|
+<modules/sensors/Dht1122>
|
||||||
|
+<modules/sensors/Ds18b20>
|
||||||
|
+<modules/sensors/Impulse>
|
||||||
|
+<modules/sensors/RTC>
|
||||||
|
+<modules/sensors/S8>
|
||||||
|
+<modules/sensors/Sht20>
|
||||||
|
+<modules/sensors/Sht30>
|
||||||
|
+<modules/sensors/Sonar>
|
||||||
|
+<modules/sensors/UART>
|
||||||
|
+<modules/exec/AnalogBtn>
|
||||||
|
+<modules/exec/ButtonIn>
|
||||||
|
+<modules/exec/ButtonOut>
|
||||||
|
+<modules/exec/Buzzer>
|
||||||
|
+<modules/exec/Enconder>
|
||||||
|
+<modules/exec/IoTServo>
|
||||||
|
+<modules/exec/Mcp23017>
|
||||||
|
+<modules/exec/Multitouch>
|
||||||
|
+<modules/exec/Pcf8574>
|
||||||
|
+<modules/exec/Pwm32>
|
||||||
|
+<modules/exec/TelegramLT>
|
||||||
|
+<modules/display/Lcd2004>
|
||||||
|
+<modules/display/Oled64>
|
||||||
|
+<modules/display/Smi2_m>
|
||||||
|
|
||||||
|
[env:esp32c6_8mb_fromitems]
|
||||||
|
lib_deps =
|
||||||
|
https://github.com/enjoyneering/AHTxx.git
|
||||||
|
adafruit/Adafruit BME280 Library
|
||||||
|
adafruit/Adafruit BMP280 Library
|
||||||
|
beegee-tokyo/DHT sensor library for ESPx
|
||||||
|
https://github.com/pstolarz/Arduino-Temperature-Control-Library.git#OneWireNg
|
||||||
|
robtillaart/SHT2x@^0.1.1
|
||||||
|
WEMOS SHT3x@1.0.0
|
||||||
|
plerup/EspSoftwareSerial
|
||||||
|
gyverlibs/EncButton @ ^2.0
|
||||||
|
https://github.com/RoboticsBrno/ServoESP32#v1.0.3
|
||||||
|
adafruit/Adafruit MCP23017 Arduino Library@^2.1.0
|
||||||
|
adafruit/Adafruit BusIO @ ^1.13.2
|
||||||
|
adafruit/Adafruit BusIO @ ^1.13.2
|
||||||
|
https://github.com/robotclass/RobotClass_LiquidCrystal_I2C
|
||||||
|
marcoschwartz/LiquidCrystal_I2C@^1.1.4
|
||||||
|
https://github.com/stblassitude/Adafruit_SSD1306_Wemos_OLED
|
||||||
|
https://github.com/adafruit/Adafruit-GFX-Library
|
||||||
|
build_src_filter =
|
||||||
|
+<modules/virtual/Cron>
|
||||||
|
+<modules/virtual/Loging>
|
||||||
|
+<modules/virtual/LogingDaily>
|
||||||
|
+<modules/virtual/Math>
|
||||||
|
+<modules/virtual/owmWeather>
|
||||||
|
+<modules/virtual/Ping>
|
||||||
|
+<modules/virtual/Timer>
|
||||||
|
+<modules/virtual/Variable>
|
||||||
|
+<modules/virtual/VButton>
|
||||||
|
+<modules/sensors/A02Distance>
|
||||||
|
+<modules/sensors/Acs712>
|
||||||
|
+<modules/sensors/AhtXX>
|
||||||
|
+<modules/sensors/AnalogAdc>
|
||||||
|
+<modules/sensors/BL0937>
|
||||||
|
+<modules/sensors/Bme280>
|
||||||
|
+<modules/sensors/Bmp280>
|
||||||
|
+<modules/sensors/Dht1122>
|
||||||
|
+<modules/sensors/Ds18b20>
|
||||||
|
+<modules/sensors/Impulse>
|
||||||
|
+<modules/sensors/RTC>
|
||||||
|
+<modules/sensors/S8>
|
||||||
|
+<modules/sensors/Sht20>
|
||||||
|
+<modules/sensors/Sht30>
|
||||||
|
+<modules/sensors/Sonar>
|
||||||
|
+<modules/sensors/UART>
|
||||||
|
+<modules/exec/AnalogBtn>
|
||||||
|
+<modules/exec/ButtonIn>
|
||||||
|
+<modules/exec/ButtonOut>
|
||||||
|
+<modules/exec/Buzzer>
|
||||||
|
+<modules/exec/Enconder>
|
||||||
|
+<modules/exec/IoTServo>
|
||||||
|
+<modules/exec/Mcp23017>
|
||||||
|
+<modules/exec/Multitouch>
|
||||||
|
+<modules/exec/Pcf8574>
|
||||||
|
+<modules/exec/Pwm32>
|
||||||
|
+<modules/exec/TelegramLT>
|
||||||
|
+<modules/display/Lcd2004>
|
||||||
|
+<modules/display/Oled64>
|
||||||
|
+<modules/display/Smi2_m>
|
||||||
|
|
||||||
[env:bk7231n_fromitems]
|
[env:bk7231n_fromitems]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "DebugTrace.h"
|
#include "DebugTrace.h"
|
||||||
#if defined(RESTART_DEBUG_INFO) && defined(ESP32) && !defined(esp32c3m_4mb)
|
#if defined(RESTART_DEBUG_INFO)
|
||||||
// #ifdef RESTART_DEBUG_INFO
|
// #ifdef RESTART_DEBUG_INFO
|
||||||
__NOINIT_ATTR static re_restart_debug_t _debug_info;
|
__NOINIT_ATTR static re_restart_debug_t _debug_info;
|
||||||
|
|
||||||
@@ -282,12 +282,14 @@ void sendDebugTraceAndFreeMemory(bool postMsg)
|
|||||||
void printDebugTrace() {}
|
void printDebugTrace() {}
|
||||||
void sendDebugTraceAndFreeMemory(bool) {}
|
void sendDebugTraceAndFreeMemory(bool) {}
|
||||||
//void IRAM_ATTR debugUpdate() {}
|
//void IRAM_ATTR debugUpdate() {}
|
||||||
|
#if !defined(esp32c6_4mb) && !defined(esp32c6_8mb)
|
||||||
extern "C" void __wrap_esp_panic_handler(void *info)
|
extern "C" void __wrap_esp_panic_handler(void *info)
|
||||||
{
|
{
|
||||||
// Call the original panic handler function to finish processing this error (creating a core dump for example...)
|
// Call the original panic handler function to finish processing this error (creating a core dump for example...)
|
||||||
__real_esp_panic_handler(info);
|
__real_esp_panic_handler(info);
|
||||||
}
|
}
|
||||||
#endif // RESTART_DEBUG_INFO
|
#endif //esp32c6
|
||||||
|
#endif // !RESTART_DEBUG_INFO
|
||||||
|
|
||||||
#if defined(ESP32)
|
#if defined(ESP32)
|
||||||
|
|
||||||
@@ -299,8 +301,10 @@ extern "C" void __wrap_esp_panic_handler(void *info)
|
|||||||
|
|
||||||
void startWatchDog()
|
void startWatchDog()
|
||||||
{
|
{
|
||||||
|
#if !defined(esp32c6_4mb) && !defined(esp32c6_8mb) //TODO esp32-c6 переписать esp_task_wdt_init
|
||||||
esp_task_wdt_init(WDT_TIMEOUT, true); // enable panic so ESP32 restarts
|
esp_task_wdt_init(WDT_TIMEOUT, true); // enable panic so ESP32 restarts
|
||||||
esp_task_wdt_add(NULL); // add current thread to WDT watch
|
esp_task_wdt_add(NULL); // add current thread to WDT watch
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" bool verifyRollbackLater()
|
extern "C" bool verifyRollbackLater()
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
#include "EspFileSystem.h"
|
#include "EspFileSystem.h"
|
||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
|
#if defined(esp32c6_4mb) || defined(esp32c6_8mb)
|
||||||
|
#include "esp_mac.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
bool fileSystemInit()
|
bool fileSystemInit()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ void setup() {
|
|||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
Serial.flush();
|
Serial.flush();
|
||||||
//----------- Отладка EXCEPTION (функции с заглушками для отключения) ---------
|
//----------- Отладка EXCEPTION (функции с заглушками для отключения) ---------
|
||||||
#if defined(RESTART_DEBUG_INFO) && defined(ESP32) && !defined(esp32c3m_4mb)
|
#if defined(RESTART_DEBUG_INFO)
|
||||||
//Привязка коллбэк функции для вызова при перезагрузке
|
//Привязка коллбэк функции для вызова при перезагрузке
|
||||||
esp_register_shutdown_handler(debugUpdate);
|
esp_register_shutdown_handler(debugUpdate);
|
||||||
#endif // RESTART_DEBUG_INFO
|
#endif // RESTART_DEBUG_INFO
|
||||||
@@ -156,7 +156,7 @@ void setup() {
|
|||||||
#endif
|
#endif
|
||||||
SerialPrint("i", "i2c", F("i2c pins overriding done"));
|
SerialPrint("i", "i2c", F("i2c pins overriding done"));
|
||||||
}
|
}
|
||||||
#if defined(RESTART_DEBUG_INFO) && defined(ESP32) && !defined(esp32c3m_4mb)
|
#if defined(RESTART_DEBUG_INFO)
|
||||||
esp_reset_reason_t esp_reason = esp_reset_reason();
|
esp_reset_reason_t esp_reason = esp_reset_reason();
|
||||||
if (esp_reason == ESP_RST_UNKNOWN || esp_reason == ESP_RST_POWERON)
|
if (esp_reason == ESP_RST_UNKNOWN || esp_reason == ESP_RST_POWERON)
|
||||||
bootloop_panic_count = 0;
|
bootloop_panic_count = 0;
|
||||||
@@ -291,7 +291,7 @@ void setup() {
|
|||||||
Serial.println("--------test end---------");
|
Serial.println("--------test end---------");
|
||||||
|
|
||||||
stopErrorMarker(SETUPLAST_ERRORMARKER);
|
stopErrorMarker(SETUPLAST_ERRORMARKER);
|
||||||
#if defined(RESTART_DEBUG_INFO) && defined(ESP32) && !defined(esp32c3m_4mb)
|
#if defined(RESTART_DEBUG_INFO)
|
||||||
bootloop_panic_count = 0;
|
bootloop_panic_count = 0;
|
||||||
#endif // RESTART_DEBUG_INFO
|
#endif // RESTART_DEBUG_INFO
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ String ESP_getResetReason(void) {
|
|||||||
return ESP.getResetReason();
|
return ESP.getResetReason();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(esp32s2_4mb) || defined(esp32s3_16mb) || defined(esp32c3m_4mb)
|
#if defined(esp32s2_4mb) || defined(esp32s3_16mb) || defined(esp32c3m_4mb) || defined(esp32c6_4mb) || defined(esp32c6_8mb)
|
||||||
String ESP_getResetReason(void) {
|
String ESP_getResetReason(void) {
|
||||||
// return ESP32GetResetReason(0); // CPU 0
|
// return ESP32GetResetReason(0); // CPU 0
|
||||||
esp_reset_reason_t esp_reason = esp_reset_reason();
|
esp_reset_reason_t esp_reason = esp_reset_reason();
|
||||||
@@ -102,8 +102,8 @@ String ESP32GetResetReason(uint32_t cpu_no) {
|
|||||||
return F("Timer Group1 Watchdog reset digital core"); // 8
|
return F("Timer Group1 Watchdog reset digital core"); // 8
|
||||||
case RTCWDT_SYS_RESET:
|
case RTCWDT_SYS_RESET:
|
||||||
return F("RTC Watchdog Reset digital core"); // 9
|
return F("RTC Watchdog Reset digital core"); // 9
|
||||||
case INTRUSION_RESET:
|
// case INTRUSION_RESET:
|
||||||
return F("Instrusion tested to reset CPU"); // 10
|
// return F("Instrusion tested to reset CPU"); // 10
|
||||||
case TG0WDT_CPU_RESET:
|
case TG0WDT_CPU_RESET:
|
||||||
return F("Time Group reset CPU"); // 11
|
return F("Time Group reset CPU"); // 11
|
||||||
case RTC_SW_CPU_RESET:
|
case RTC_SW_CPU_RESET:
|
||||||
|
|||||||
@@ -92,6 +92,12 @@
|
|||||||
"esp32*": [
|
"esp32*": [
|
||||||
"dfrobot/DFRobotDFPlayerMini @ ^1.0.5"
|
"dfrobot/DFRobotDFPlayerMini @ ^1.0.5"
|
||||||
],
|
],
|
||||||
|
"esp32c6_4mb": [
|
||||||
|
"exclude"
|
||||||
|
],
|
||||||
|
"esp32c6_8mb": [
|
||||||
|
"exclude"
|
||||||
|
],
|
||||||
"esp82*": [
|
"esp82*": [
|
||||||
"dfrobot/DFRobotDFPlayerMini @ ^1.0.5"
|
"dfrobot/DFRobotDFPlayerMini @ ^1.0.5"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
extern IoTGpio IoTgpio;
|
extern IoTGpio IoTgpio;
|
||||||
|
|
||||||
class Pwm32 : public IoTItem {
|
class Pwm32 : public IoTItem {
|
||||||
private:
|
private:
|
||||||
int _pin;
|
int _pin;
|
||||||
int _freq;
|
int _freq;
|
||||||
int _apin, _oldValue;
|
int _apin, _oldValue;
|
||||||
@@ -16,7 +16,7 @@ class Pwm32 : public IoTItem {
|
|||||||
int _ledChannel;
|
int _ledChannel;
|
||||||
int _resolution;
|
int _resolution;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Pwm32(String parameters): IoTItem(parameters) {
|
Pwm32(String parameters): IoTItem(parameters) {
|
||||||
_interval = _interval / 1000; // корректируем величину интервала int, теперь он в миллисекундах
|
_interval = _interval / 1000; // корректируем величину интервала int, теперь он в миллисекундах
|
||||||
|
|
||||||
@@ -26,8 +26,12 @@ class Pwm32 : public IoTItem {
|
|||||||
jsonRead(parameters, "PWM_resolution", _resolution);
|
jsonRead(parameters, "PWM_resolution", _resolution);
|
||||||
|
|
||||||
pinMode(_pin, OUTPUT);
|
pinMode(_pin, OUTPUT);
|
||||||
|
#if defined(esp32c6_4mb) || defined(esp32c6_8mb)
|
||||||
|
ledcAttachChannel(_pin, _freq, _resolution, _ledChannel);
|
||||||
|
#else
|
||||||
ledcSetup(_ledChannel, _freq, _resolution);
|
ledcSetup(_ledChannel, _freq, _resolution);
|
||||||
ledcAttachPin(_pin, _ledChannel);
|
ledcAttachPin(_pin, _ledChannel);
|
||||||
|
#endif
|
||||||
ledcWrite(_ledChannel, value.valD);
|
ledcWrite(_ledChannel, value.valD);
|
||||||
|
|
||||||
_resolution = pow(2, _resolution); // переводим биты в значение
|
_resolution = pow(2, _resolution); // переводим биты в значение
|
||||||
|
|||||||
@@ -42,6 +42,12 @@
|
|||||||
"esp32*": [
|
"esp32*": [
|
||||||
"https://github.com/milesburton/Arduino-Temperature-Control-Library"
|
"https://github.com/milesburton/Arduino-Temperature-Control-Library"
|
||||||
],
|
],
|
||||||
|
"esp32c6_4mb": [
|
||||||
|
"https://github.com/pstolarz/Arduino-Temperature-Control-Library.git#OneWireNg"
|
||||||
|
],
|
||||||
|
"esp32c6_8mb": [
|
||||||
|
"https://github.com/pstolarz/Arduino-Temperature-Control-Library.git#OneWireNg"
|
||||||
|
],
|
||||||
"esp82*": [
|
"esp82*": [
|
||||||
"https://github.com/milesburton/Arduino-Temperature-Control-Library"
|
"https://github.com/milesburton/Arduino-Temperature-Control-Library"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ IPAddress stringToIp(String strIp)
|
|||||||
void routerConnect()
|
void routerConnect()
|
||||||
{
|
{
|
||||||
#if !defined LIBRETINY
|
#if !defined LIBRETINY
|
||||||
|
#if defined(esp32c6_4mb) || defined(esp32c6_8mb)
|
||||||
|
WiFi.setAutoReconnect(false);
|
||||||
|
#else
|
||||||
WiFi.setAutoConnect(false);
|
WiFi.setAutoConnect(false);
|
||||||
|
#endif
|
||||||
WiFi.persistent(false);
|
WiFi.persistent(false);
|
||||||
#endif
|
#endif
|
||||||
/* String s_staip = "192.168.2.62";
|
/* String s_staip = "192.168.2.62";
|
||||||
|
|||||||
32
tools/patch32c6.py
Normal file
32
tools/patch32c6.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
from sys import platform
|
||||||
|
|
||||||
|
if platform == "linux" or platform == "linux2":
|
||||||
|
# linux
|
||||||
|
devkitm = '/home/rise/.platformio/platforms/espressif32/boards/esp32-c6-devkitm-1.json'
|
||||||
|
devkitc = '/home/rise/.platformio/platforms/espressif32/boards/esp32-c6-devkitc-1.json'
|
||||||
|
else:
|
||||||
|
# windows
|
||||||
|
devkitm = os.environ['USERPROFILE'] + '\\.platformio\\platforms\\espressif32\\boards\\esp32-c6-devkitm-1.json'
|
||||||
|
devkitc = os.environ['USERPROFILE'] + '\\.platformio\\platforms\\espressif32\\boards\\esp32-c6-devkitc-1.json'
|
||||||
|
|
||||||
|
def add_arduino_to_frameworks(file_name):
|
||||||
|
with open(file_name, 'r+') as f:
|
||||||
|
data = json.load(f)
|
||||||
|
frameworks = data['frameworks']
|
||||||
|
if 'arduino' not in frameworks:
|
||||||
|
frameworks.insert(frameworks.index('espidf') + 1, 'arduino')
|
||||||
|
data['frameworks'] = frameworks
|
||||||
|
f.seek(0)
|
||||||
|
json.dump(data, f, indent=4)
|
||||||
|
f.truncate()
|
||||||
|
else:
|
||||||
|
print(f"Arduino already exists in {file_name}")
|
||||||
|
|
||||||
|
if os.path.exists(devkitm) and os.path.exists(devkitc):
|
||||||
|
add_arduino_to_frameworks(devkitm)
|
||||||
|
add_arduino_to_frameworks(devkitc)
|
||||||
|
else:
|
||||||
|
print("One or both files do not exist.")
|
||||||
Reference in New Issue
Block a user