mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-11 17:14:27 +00:00
[ESP-IDF5.1] Add initial Custom builds for ESP32-C2 and ESP32-C6
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32c2_out.ld"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DESP32_4M -DESP32C2",
|
||||
"f_cpu": "120000000L",
|
||||
"f_flash": "60000000L",
|
||||
"flash_mode": "qio",
|
||||
"mcu": "esp32c2",
|
||||
"variant": "esp32c2",
|
||||
"partitions": "esp32_partition_app1810k_spiffs316k.csv"
|
||||
},
|
||||
"connectivity": [
|
||||
"wifi",
|
||||
"bluetooth"
|
||||
],
|
||||
"debug": {
|
||||
"openocd_target": "esp32c2.cfg"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"espidf"
|
||||
],
|
||||
"name": "Espressif Generic ESP32-C2 = 4M Flash, ESPEasy 1810k Code/OTA 316k FS",
|
||||
"upload": {
|
||||
"flash_size": "4MB",
|
||||
"maximum_ram_size": 278528,
|
||||
"maximum_size": 4194304,
|
||||
"require_upload_port": true,
|
||||
"speed": 460800
|
||||
},
|
||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
|
||||
"vendor": "Espressif"
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32c6_out.ld"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DESP32_4M -DESP32C6",
|
||||
"f_cpu": "160000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "qio",
|
||||
"mcu": "esp32c6",
|
||||
"variant": "esp32c6",
|
||||
"partitions": "esp32_partition_app1810k_spiffs316k.csv"
|
||||
},
|
||||
"connectivity": [
|
||||
"wifi",
|
||||
"bluetooth"
|
||||
],
|
||||
"debug": {
|
||||
"openocd_target": "esp32c6.cfg"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"espidf"
|
||||
],
|
||||
"name": "Espressif Generic ESP32-C6 >= 4M Flash, ESPEasy 1810k Code/OTA 316k FS",
|
||||
"upload": {
|
||||
"flash_size": "4MB",
|
||||
"maximum_ram_size": 327680,
|
||||
"maximum_size": 4194304,
|
||||
"require_upload_port": true,
|
||||
"speed": 460800
|
||||
},
|
||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
|
||||
"vendor": "Espressif"
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino":{
|
||||
"ldscript": "esp32c6_out.ld"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": "-DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE -DESP32_4M -DESP32C6 -DARDUINO_USB_CDC_ON_BOOT=1",
|
||||
"f_cpu": "160000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "qio",
|
||||
"mcu": "esp32c6",
|
||||
"variant": "esp32c6",
|
||||
"partitions": "esp32_partition_app1810k_spiffs316k.csv"
|
||||
},
|
||||
"connectivity": [
|
||||
"wifi",
|
||||
"bluetooth"
|
||||
],
|
||||
"debug": {
|
||||
"default_tool": "esp-builtin",
|
||||
"onboard_tools": [
|
||||
"esp-builtin"
|
||||
],
|
||||
"openocd_target": "esp32c6.cfg"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"espidf"
|
||||
],
|
||||
"name": "Espressif Generic ESP32-C6 >= 4M Flash, ESPEasy 1810k Code/OTA 316k FS",
|
||||
"upload": {
|
||||
"flash_size": "4MB",
|
||||
"maximum_ram_size": 327680,
|
||||
"maximum_size": 4194304,
|
||||
"require_upload_port": true,
|
||||
"speed": 460800
|
||||
},
|
||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
|
||||
"vendor": "Espressif"
|
||||
}
|
||||
@@ -146,8 +146,13 @@ void DIRECT_PINMODE_INPUT_ISR(IO_REG_TYPE pin);
|
||||
static inline __attribute__((always_inline))
|
||||
IO_REG_TYPE directRead(IO_REG_TYPE pin)
|
||||
{
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3
|
||||
return (GPIO.in.val >> pin) & 0x1;
|
||||
#elif CONFIG_IDF_TARGET_ESP32C6
|
||||
if ( pin < 32 )
|
||||
return (GPIO.in.val >> pin) & 0x1;
|
||||
else if ( pin < 46 )
|
||||
return (GPIO.in1.val >> (pin - 32)) & 0x1;
|
||||
#else // plain ESP32
|
||||
if ( pin < 32 )
|
||||
return (GPIO.in >> pin) & 0x1;
|
||||
@@ -161,8 +166,14 @@ IO_REG_TYPE directRead(IO_REG_TYPE pin)
|
||||
static inline __attribute__((always_inline))
|
||||
void directWriteLow(IO_REG_TYPE pin)
|
||||
{
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3
|
||||
GPIO.out_w1tc.val = ((uint32_t)1 << pin);
|
||||
#elif CONFIG_IDF_TARGET_ESP32C6
|
||||
if ( pin < 32 )
|
||||
GPIO.out_w1tc.val = ((uint32_t)1 << pin);
|
||||
else if ( pin < 46 )
|
||||
GPIO.out1_w1tc.val = ((uint32_t)1 << (pin - 32));
|
||||
|
||||
#else // plain ESP32
|
||||
if ( pin < 32 )
|
||||
GPIO.out_w1tc = ((uint32_t)1 << pin);
|
||||
@@ -174,8 +185,14 @@ void directWriteLow(IO_REG_TYPE pin)
|
||||
static inline __attribute__((always_inline))
|
||||
void directWriteHigh(IO_REG_TYPE pin)
|
||||
{
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3
|
||||
GPIO.out_w1ts.val = ((uint32_t)1 << pin);
|
||||
#elif CONFIG_IDF_TARGET_ESP32C6
|
||||
if ( pin < 32 )
|
||||
GPIO.out_w1ts.val = ((uint32_t)1 << pin);
|
||||
else if ( pin < 46 )
|
||||
GPIO.out1_w1ts.val = ((uint32_t)1 << (pin - 32));
|
||||
|
||||
#else // plain ESP32
|
||||
if ( pin < 32 )
|
||||
GPIO.out_w1ts = ((uint32_t)1 << pin);
|
||||
@@ -187,7 +204,7 @@ void directWriteHigh(IO_REG_TYPE pin)
|
||||
static inline __attribute__((always_inline))
|
||||
void directModeInput(IO_REG_TYPE pin)
|
||||
{
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3
|
||||
GPIO.enable_w1tc.val = ((uint32_t)1 << (pin));
|
||||
#else
|
||||
if ( GPIO_IS_VALID_GPIO(pin) )
|
||||
@@ -202,10 +219,17 @@ void directModeInput(IO_REG_TYPE pin)
|
||||
}
|
||||
#endif
|
||||
// Input
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
if ( pin < 32 )
|
||||
GPIO.enable_w1tc.val = ((uint32_t)1 << pin);
|
||||
else
|
||||
GPIO.enable1_w1tc.val = ((uint32_t)1 << (pin - 32));
|
||||
#else
|
||||
if ( pin < 32 )
|
||||
GPIO.enable_w1tc = ((uint32_t)1 << pin);
|
||||
else
|
||||
GPIO.enable1_w1tc.val = ((uint32_t)1 << (pin - 32));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -213,7 +237,7 @@ void directModeInput(IO_REG_TYPE pin)
|
||||
static inline __attribute__((always_inline))
|
||||
void directModeOutput(IO_REG_TYPE pin)
|
||||
{
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3
|
||||
GPIO.enable_w1ts.val = ((uint32_t)1 << (pin));
|
||||
#else
|
||||
if ( GPIO_IS_VALID_GPIO(pin) && pin <= 33 ) // pins above 33 can be only inputs
|
||||
@@ -228,10 +252,18 @@ void directModeOutput(IO_REG_TYPE pin)
|
||||
}
|
||||
#endif
|
||||
// Output
|
||||
#if CONFIG_IDF_TARGET_ESP32C6
|
||||
if ( pin < 32 )
|
||||
GPIO.enable_w1ts.val = ((uint32_t)1 << pin);
|
||||
else // already validated to pins <= 33
|
||||
GPIO.enable1_w1ts.val = ((uint32_t)1 << (pin - 32));
|
||||
|
||||
#else
|
||||
if ( pin < 32 )
|
||||
GPIO.enable_w1ts = ((uint32_t)1 << pin);
|
||||
else // already validated to pins <= 33
|
||||
GPIO.enable1_w1ts.val = ((uint32_t)1 << (pin - 32));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ extra_configs =
|
||||
platformio_esp32s2_envs.ini
|
||||
platformio_esp32s3_envs.ini
|
||||
platformio_special_envs.ini
|
||||
platformio_esp32c2_envs.ini
|
||||
platformio_esp32c6_envs.ini
|
||||
|
||||
;default_envs = normal_ESP32_4M
|
||||
default_envs = max_ESP32_16M8M_LittleFS
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
|
||||
|
||||
[esp32c2_common]
|
||||
extends = esp32_base
|
||||
lib_ignore = ${esp32_always.lib_ignore}
|
||||
ESP32_ping
|
||||
IRremoteESP8266
|
||||
HeatpumpIR
|
||||
ESP32 BLE Arduino
|
||||
build_flags = ${esp32_base.build_flags}
|
||||
-DFEATURE_ARDUINO_OTA=1
|
||||
-DESP32C2
|
||||
extra_scripts = ${esp32_base.extra_scripts}
|
||||
build_unflags = ${esp32_base.build_unflags}
|
||||
-fexceptions
|
||||
|
||||
[esp32c2_common_LittleFS]
|
||||
extends = esp32_base_idf5
|
||||
build_flags = ${esp32_base_idf5.build_flags}
|
||||
-DFEATURE_ARDUINO_OTA=1
|
||||
-DUSE_LITTLEFS
|
||||
-DESP32C2
|
||||
extra_scripts = ${esp32_base_idf5.extra_scripts}
|
||||
build_unflags = ${esp32_base_idf5.build_unflags}
|
||||
-fexceptions
|
||||
board_build.filesystem = littlefs
|
||||
lib_ignore = ${esp32_base_idf5.lib_ignore}
|
||||
NeoPixelBus
|
||||
NeoPixelBus_wrapper
|
||||
Adafruit NeoMatrix via NeoPixelBus
|
||||
|
||||
|
||||
[env:custom_ESP32c2_4M316k_LittleFS]
|
||||
extends = esp32c2_common_LittleFS
|
||||
board = esp32c2
|
||||
build_flags = ${esp32c2_common_LittleFS.build_flags}
|
||||
-DPLUGIN_BUILD_CUSTOM
|
||||
extra_scripts = ${esp32c2_common_LittleFS.extra_scripts}
|
||||
pre:tools/pio/pre_custom_esp32c2.py
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
|
||||
|
||||
[esp32c6_common]
|
||||
extends = esp32_base
|
||||
lib_ignore = ${esp32_always.lib_ignore}
|
||||
ESP32_ping
|
||||
IRremoteESP8266
|
||||
HeatpumpIR
|
||||
ESP32 BLE Arduino
|
||||
build_flags = ${esp32_base.build_flags}
|
||||
-DFEATURE_ARDUINO_OTA=1
|
||||
-DESP32C6
|
||||
extra_scripts = ${esp32_base.extra_scripts}
|
||||
build_unflags = ${esp32_base.build_unflags}
|
||||
-fexceptions
|
||||
|
||||
[esp32c6_common_LittleFS]
|
||||
extends = esp32_base_idf5
|
||||
build_flags = ${esp32_base_idf5.build_flags}
|
||||
-DFEATURE_ARDUINO_OTA=1
|
||||
-DUSE_LITTLEFS
|
||||
-DESP32C6
|
||||
extra_scripts = ${esp32_base_idf5.extra_scripts}
|
||||
build_unflags = ${esp32_base_idf5.build_unflags}
|
||||
-fexceptions
|
||||
board_build.filesystem = littlefs
|
||||
lib_ignore = ${esp32_base_idf5.lib_ignore}
|
||||
NeoPixelBus
|
||||
NeoPixelBus_wrapper
|
||||
Adafruit NeoMatrix via NeoPixelBus
|
||||
|
||||
|
||||
[env:custom_ESP32c6_4M316k_LittleFS_CDC]
|
||||
extends = esp32c6_common_LittleFS
|
||||
board = esp32c6cdc
|
||||
build_flags = ${esp32c6_common_LittleFS.build_flags}
|
||||
-DPLUGIN_BUILD_CUSTOM
|
||||
extra_scripts = ${esp32c6_common_LittleFS.extra_scripts}
|
||||
pre:tools/pio/pre_custom_esp32c6.py
|
||||
@@ -722,7 +722,7 @@ bool SettingsStruct_tmpl<N_TASKS>::getPinBootStateIndex(
|
||||
|
||||
index_high = gpio_pin - maxStates;
|
||||
|
||||
# if defined(ESP32_CLASSIC) || defined(ESP32C3)
|
||||
# if defined(ESP32_CLASSIC) || defined(ESP32C2) || defined(ESP32C3)
|
||||
|
||||
// These can all store in the PinBootStates_ESP32 array
|
||||
return (index_high < maxStatesesp32);
|
||||
|
||||
@@ -35,9 +35,15 @@
|
||||
# elif CONFIG_IDF_TARGET_ESP32S2 // ESP32-S2
|
||||
#define VSPI_FSPI_SHORT_STRING "FSPI"
|
||||
#define VSPI_FSPI_OPTIONS_STRING "FSPI: CLK=GPIO-36, MISO=GPIO-37, MOSI=GPIO-35"
|
||||
# elif CONFIG_IDF_TARGET_ESP32C2 // ESP32-C2
|
||||
#define VSPI_FSPI_SHORT_STRING "FSPI"
|
||||
#define VSPI_FSPI_OPTIONS_STRING "FSPI: CLK=GPIO-6, MISO=GPIO-2, MOSI=GPIO-7"
|
||||
# elif CONFIG_IDF_TARGET_ESP32C3 // ESP32-C3
|
||||
#define VSPI_FSPI_SHORT_STRING "SPI"
|
||||
#define VSPI_FSPI_OPTIONS_STRING "SPI: CLK=GPIO-4, MISO=GPIO-5, MOSI=GPIO-6"
|
||||
# elif CONFIG_IDF_TARGET_ESP32C6 // ESP32-C6
|
||||
#define VSPI_FSPI_SHORT_STRING "FSPI"
|
||||
#define VSPI_FSPI_OPTIONS_STRING "FSPI: CLK=GPIO-6, MISO=GPIO-2, MOSI=GPIO-7"
|
||||
# elif CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
|
||||
#define VSPI_FSPI_SHORT_STRING "VSPI"
|
||||
#define VSPI_FSPI_OPTIONS_STRING "VSPI: CLK=GPIO-18, MISO=GPIO-19, MOSI=GPIO-23"
|
||||
|
||||
@@ -47,10 +47,18 @@
|
||||
#define VSPI_FSPI_SCK 36
|
||||
#define VSPI_FSPI_MISO 37
|
||||
#define VSPI_FSPI_MOSI 35
|
||||
# elif CONFIG_IDF_TARGET_ESP32C6 // ESP32-C6
|
||||
#define VSPI_FSPI_SCK 6
|
||||
#define VSPI_FSPI_MISO 2 // FSPIQ
|
||||
#define VSPI_FSPI_MOSI 7 // FSPID
|
||||
# elif CONFIG_IDF_TARGET_ESP32C3 // ESP32-C3
|
||||
#define VSPI_FSPI_SCK 4
|
||||
#define VSPI_FSPI_MISO 5
|
||||
#define VSPI_FSPI_MOSI 6
|
||||
# elif CONFIG_IDF_TARGET_ESP32C2 // ESP32-C2
|
||||
#define VSPI_FSPI_SCK 6
|
||||
#define VSPI_FSPI_MISO 2 // FSPIQ
|
||||
#define VSPI_FSPI_MOSI 7 // FSPID
|
||||
# elif CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
|
||||
#define VSPI_FSPI_SCK 18
|
||||
#define VSPI_FSPI_MISO 19
|
||||
|
||||
@@ -257,7 +257,7 @@ String getChipFeaturesString() {
|
||||
}
|
||||
|
||||
bool getFlashChipOPI_wired() {
|
||||
# ifdef ESP32_CLASSIC
|
||||
# if defined(ESP32_CLASSIC) || defined(ESP32C2)
|
||||
return false;
|
||||
|
||||
# else // ifdef ESP32_CLASSIC
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
extern "C" {
|
||||
uint8_t temprature_sens_read();
|
||||
}
|
||||
# elif defined(ESP32C3) || defined(ESP32C3) || defined(ESP32C6) || defined(ESP32S2) || defined(ESP32S3)
|
||||
# elif defined(ESP32C2) || defined(ESP32C3) || defined(ESP32C6) || defined(ESP32S2) || defined(ESP32S3)
|
||||
# if ESP_IDF_VERSION_MAJOR < 5
|
||||
# include <driver/temp_sensor.h>
|
||||
|
||||
|
||||
@@ -131,9 +131,9 @@ const __FlashStringHelper * getResetReasonString_f(uint8_t icore, bool& isDEEPSL
|
||||
case POWER_GLITCH_RESET : return F("power glitch reset digital core and rtc module");
|
||||
}
|
||||
|
||||
#elif defined(ESP32C6)
|
||||
#elif defined(ESP32C2)
|
||||
|
||||
// See tools\sdk\esp32\include\esp_rom\include\esp32c6\rom\rtc.h
|
||||
// See tools\sdk\esp32\include\esp_rom\include\esp32c2\rom\rtc.h
|
||||
switch (rtc_get_reset_reason(icore)) {
|
||||
case NO_MEAN : break;
|
||||
case POWERON_RESET : return F("Vbat power on reset");
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
Import("env")
|
||||
import os
|
||||
|
||||
# access to global construction environment
|
||||
#print env
|
||||
|
||||
# Dump construction environment (for debug purpose)
|
||||
#print env.Dump()
|
||||
|
||||
# append extra flags to global build environment
|
||||
# which later will be used to build:
|
||||
# - project source code
|
||||
# - frameworks
|
||||
# - dependent libraries
|
||||
custom_defines = []
|
||||
#env.Append(CPPDEFINES=[
|
||||
# ,"NO_HTTP_UPDATER"
|
||||
# ,("WEBSERVER_RULES_DEBUG", "0")
|
||||
#])
|
||||
if os.path.isfile('src/Custom.h'):
|
||||
custom_defines=["-DUSE_CUSTOM_H"]
|
||||
else:
|
||||
custom_defines=[
|
||||
"-DCONTROLLER_SET_ALL",
|
||||
"-DNOTIFIER_SET_NONE",
|
||||
"-DPLUGIN_BUILD_NONE",
|
||||
"-DUSES_P001", # Switch
|
||||
"-DUSES_P002", # ADC
|
||||
"-DUSES_P003", # Generic pulse counter
|
||||
"-DUSES_P004", # Dallas DS18b20
|
||||
"-DUSES_P026", # System info
|
||||
"-DUSES_P027", # INA219
|
||||
"-DUSES_P028", # BME280
|
||||
"-DUSES_P033", # Dummy
|
||||
"-DUSES_P036", # FrameOLED
|
||||
"-DUSES_P045", # MPU6050
|
||||
"-DUSES_P049", # MHZ19
|
||||
"-DUSES_P052", # SenseAir
|
||||
"-DUSES_P056", # SDS011-Dust
|
||||
"-DUSES_P059", # Encoder
|
||||
"-DUSES_P080", # Dallas iButton
|
||||
"-DUSES_P081", # Cron
|
||||
"-DUSES_P082", # GPS
|
||||
"-DUSES_P085", # AcuDC24x
|
||||
"-DUSES_P098", # PWM motor
|
||||
|
||||
"-DUSES_P100", # Pulse Counter - DS2423
|
||||
# "-DUSES_P087", # Serial Proxy
|
||||
# "-DUSES_P094", # CUL Reader
|
||||
# "-DUSES_P095", # TFT ILI9341
|
||||
"-DUSES_P097", # Touch (ESP32)
|
||||
"-DUSES_P106", # BME680
|
||||
"-DUSES_P107", # SI1145 UV index
|
||||
|
||||
"-DUSES_P146", # Cache Reader
|
||||
|
||||
|
||||
"-DUSES_C016", # Cache Controller
|
||||
"-DUSES_C018", # TTN/RN2483
|
||||
# "-DUSES_C015", # Blynk
|
||||
|
||||
"-DFEATURE_EXT_RTC=1",
|
||||
"-DFEATURE_SD=1",
|
||||
"-DFEATURE_I2CMULTIPLEXER=1",
|
||||
"-DFEATURE_TRIGONOMETRIC_FUNCTIONS_RULES=1",
|
||||
|
||||
"-DFEATURE_PLUGIN_STATS=1",
|
||||
"-DFEATURE_CHART_JS=1",
|
||||
|
||||
"-DFEATURE_SETTINGS_ARCHIVE=1",
|
||||
"-DFEATURE_DEFINE_SERIAL_CONSOLE_PORT=0",
|
||||
"-DFEATURE_ESPEASY_P2P=1",
|
||||
"-DFEATURE_CUSTOM_PROVISIONING=1",
|
||||
"-DDISABLE_SC16IS752_SPI"
|
||||
]
|
||||
|
||||
|
||||
|
||||
my_flags = env.ParseFlags(env['BUILD_FLAGS'])
|
||||
my_defines = my_flags.get("CPPDEFINES")
|
||||
env.Append(BUILD_FLAGS=custom_defines)
|
||||
#defines = {k: v for (k, v) in my_defines}
|
||||
|
||||
print("\u001b[32m Custom PIO configuration check \u001b[0m")
|
||||
# print the defines
|
||||
print("\u001b[33m CPPDEFINES: \u001b[0m {}".format(my_defines))
|
||||
print("\u001b[33m Custom CPPDEFINES: \u001b[0m {}".format(custom_defines))
|
||||
print("\u001b[32m ------------------------------- \u001b[0m")
|
||||
|
||||
|
||||
if (len(my_defines) == 0):
|
||||
print("\u001b[31m No defines are set, probably configuration error. \u001b[0m")
|
||||
raise ValueError
|
||||
@@ -0,0 +1,93 @@
|
||||
Import("env")
|
||||
import os
|
||||
|
||||
# access to global construction environment
|
||||
#print env
|
||||
|
||||
# Dump construction environment (for debug purpose)
|
||||
#print env.Dump()
|
||||
|
||||
# append extra flags to global build environment
|
||||
# which later will be used to build:
|
||||
# - project source code
|
||||
# - frameworks
|
||||
# - dependent libraries
|
||||
custom_defines = []
|
||||
#env.Append(CPPDEFINES=[
|
||||
# ,"NO_HTTP_UPDATER"
|
||||
# ,("WEBSERVER_RULES_DEBUG", "0")
|
||||
#])
|
||||
if os.path.isfile('src/Custom.h'):
|
||||
custom_defines=["-DUSE_CUSTOM_H"]
|
||||
else:
|
||||
custom_defines=[
|
||||
"-DCONTROLLER_SET_ALL",
|
||||
"-DNOTIFIER_SET_NONE",
|
||||
"-DPLUGIN_BUILD_NONE",
|
||||
"-DUSES_P001", # Switch
|
||||
"-DUSES_P002", # ADC
|
||||
"-DUSES_P003", # Generic pulse counter
|
||||
"-DUSES_P004", # Dallas DS18b20
|
||||
"-DUSES_P026", # System info
|
||||
"-DUSES_P027", # INA219
|
||||
"-DUSES_P028", # BME280
|
||||
"-DUSES_P033", # Dummy
|
||||
"-DUSES_P036", # FrameOLED
|
||||
"-DUSES_P045", # MPU6050
|
||||
"-DUSES_P049", # MHZ19
|
||||
"-DUSES_P052", # SenseAir
|
||||
"-DUSES_P056", # SDS011-Dust
|
||||
"-DUSES_P059", # Encoder
|
||||
"-DUSES_P080", # Dallas iButton
|
||||
"-DUSES_P081", # Cron
|
||||
"-DUSES_P082", # GPS
|
||||
"-DUSES_P085", # AcuDC24x
|
||||
"-DUSES_P098", # PWM motor
|
||||
|
||||
"-DUSES_P100", # Pulse Counter - DS2423
|
||||
# "-DUSES_P087", # Serial Proxy
|
||||
# "-DUSES_P094", # CUL Reader
|
||||
# "-DUSES_P095", # TFT ILI9341
|
||||
"-DUSES_P097", # Touch (ESP32)
|
||||
"-DUSES_P106", # BME680
|
||||
"-DUSES_P107", # SI1145 UV index
|
||||
|
||||
"-DUSES_P146", # Cache Reader
|
||||
|
||||
|
||||
"-DUSES_C016", # Cache Controller
|
||||
"-DUSES_C018", # TTN/RN2483
|
||||
# "-DUSES_C015", # Blynk
|
||||
|
||||
"-DFEATURE_EXT_RTC=1",
|
||||
"-DFEATURE_SD=1",
|
||||
"-DFEATURE_I2CMULTIPLEXER=1",
|
||||
"-DFEATURE_TRIGONOMETRIC_FUNCTIONS_RULES=1",
|
||||
|
||||
"-DFEATURE_PLUGIN_STATS=1",
|
||||
"-DFEATURE_CHART_JS=1",
|
||||
|
||||
"-DFEATURE_SETTINGS_ARCHIVE=1",
|
||||
"-DFEATURE_DEFINE_SERIAL_CONSOLE_PORT=0",
|
||||
"-DFEATURE_ESPEASY_P2P=1",
|
||||
"-DFEATURE_CUSTOM_PROVISIONING=1",
|
||||
"-DDISABLE_SC16IS752_SPI"
|
||||
]
|
||||
|
||||
|
||||
|
||||
my_flags = env.ParseFlags(env['BUILD_FLAGS'])
|
||||
my_defines = my_flags.get("CPPDEFINES")
|
||||
env.Append(BUILD_FLAGS=custom_defines)
|
||||
#defines = {k: v for (k, v) in my_defines}
|
||||
|
||||
print("\u001b[32m Custom PIO configuration check \u001b[0m")
|
||||
# print the defines
|
||||
print("\u001b[33m CPPDEFINES: \u001b[0m {}".format(my_defines))
|
||||
print("\u001b[33m Custom CPPDEFINES: \u001b[0m {}".format(custom_defines))
|
||||
print("\u001b[32m ------------------------------- \u001b[0m")
|
||||
|
||||
|
||||
if (len(my_defines) == 0):
|
||||
print("\u001b[31m No defines are set, probably configuration error. \u001b[0m")
|
||||
raise ValueError
|
||||
Reference in New Issue
Block a user