Add support for ESP32C3-Mini boards (intended final target)
This commit is contained in:
parent
2e5d8a9eec
commit
bb73ecedfb
|
|
@ -2,5 +2,4 @@
|
||||||
#define GPIO_GREEN 18
|
#define GPIO_GREEN 18
|
||||||
#define GPIO_BLUE 16
|
#define GPIO_BLUE 16
|
||||||
#define GPIO_COOLWHITE 15
|
#define GPIO_COOLWHITE 15
|
||||||
#define GPIO_WARMWHITE 19
|
#define GPIO_WARMWHITE 19
|
||||||
#define BOARD "ESP32"
|
|
||||||
5
include/esp32c3.h
Normal file
5
include/esp32c3.h
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#define GPIO_RED 5
|
||||||
|
#define GPIO_GREEN 6
|
||||||
|
#define GPIO_BLUE 7
|
||||||
|
#define GPIO_COOLWHITE 20
|
||||||
|
#define GPIO_WARMWHITE 21
|
||||||
|
|
@ -2,5 +2,4 @@
|
||||||
#define GPIO_GREEN 12
|
#define GPIO_GREEN 12
|
||||||
#define GPIO_BLUE 15
|
#define GPIO_BLUE 15
|
||||||
#define GPIO_COOLWHITE 4
|
#define GPIO_COOLWHITE 4
|
||||||
#define GPIO_WARMWHITE 5
|
#define GPIO_WARMWHITE 5
|
||||||
#define BOARD "ESP8266"
|
|
||||||
|
|
@ -10,12 +10,17 @@
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
;default_envs = esp32doit-devkit-v1
|
;default_envs = esp32doit-devkit-v1
|
||||||
|
default_envs = esp32-c3-devkitm-1
|
||||||
;default_envs = nodemcuv2
|
;default_envs = nodemcuv2
|
||||||
default_envs = huzzah
|
;default_envs = huzzah
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
build_flags =
|
build_flags =
|
||||||
-D DEBUG=true
|
-D DEBUG=true
|
||||||
|
-D BOARD_ESP32_DEV=1
|
||||||
|
-D BOARD_ESP32_C3=2
|
||||||
|
-D BOARD_ESP8266_DEV=3
|
||||||
|
-D BOARD_ESP8266_HUZZAH=4
|
||||||
lib_deps =
|
lib_deps =
|
||||||
tzapu/WiFiManager@^2.0.17
|
tzapu/WiFiManager@^2.0.17
|
||||||
|
|
||||||
|
|
@ -24,26 +29,46 @@ platform = espressif32
|
||||||
board = esp32doit-devkit-v1
|
board = esp32doit-devkit-v1
|
||||||
framework = arduino
|
framework = arduino
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
upload_protocol = espota
|
;upload_protocol = espota
|
||||||
upload_port = 192.168.2.217
|
;upload_port = 192.168.2.217
|
||||||
;upload_port = COM7
|
upload_port = COM7
|
||||||
build_flags =
|
build_flags =
|
||||||
|
-D JAJ_BOARD_TARGET=BOARD_ESP32_DEV
|
||||||
${common.build_flags}
|
${common.build_flags}
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${common.lib_deps}
|
${common.lib_deps}
|
||||||
lib_compat_mode = strict
|
lib_compat_mode = strict
|
||||||
|
|
||||||
|
[env:esp32-c3-devkitm-1]
|
||||||
|
platform = espressif32
|
||||||
|
board = esp32-c3-devkitm-1
|
||||||
|
framework = arduino
|
||||||
|
monitor_speed = 115200
|
||||||
|
;upload_protocol = espota
|
||||||
|
;upload_port = 192.168.2.217
|
||||||
|
upload_port = COM9
|
||||||
|
board_build.flash_mode = dio
|
||||||
|
build_flags =
|
||||||
|
-D ARDUINO_USB_MODE=1
|
||||||
|
-D ARDUINO_USB_CDC_ON_BOOT=1
|
||||||
|
-D JAJ_BOARD_TARGET=BOARD_ESP32_C3
|
||||||
|
${common.build_flags}
|
||||||
|
|
||||||
|
lib_deps =
|
||||||
|
${common.lib_deps}
|
||||||
|
lib_compat_mode = strict
|
||||||
|
|
||||||
[env:nodemcuv2]
|
[env:nodemcuv2]
|
||||||
platform = https://github.com/platformio/platform-espressif8266.git
|
platform = https://github.com/platformio/platform-espressif8266.git
|
||||||
board = nodemcuv2
|
board = nodemcuv2
|
||||||
framework = arduino
|
framework = arduino
|
||||||
upload_protocol = espota
|
upload_protocol = espota
|
||||||
upload_port = 192.168.2.238
|
upload_port = 192.168.2.242
|
||||||
;upload_port = COM6
|
;upload_port = COM6
|
||||||
upload_speed = 115200
|
upload_speed = 115200
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
build_flags =
|
build_flags =
|
||||||
|
-D JAJ_BOARD_TARGET=BOARD_ESP8266_DEV
|
||||||
${common.build_flags}
|
${common.build_flags}
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${common.lib_deps}
|
${common.lib_deps}
|
||||||
|
|
@ -57,6 +82,7 @@ upload_port = COM6
|
||||||
upload_speed = 115200
|
upload_speed = 115200
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
build_flags =
|
build_flags =
|
||||||
|
-D JAJ_BOARD_TARGET=BOARD_ESP8266_HUZZAH
|
||||||
${common.build_flags}
|
${common.build_flags}
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${common.lib_deps}
|
${common.lib_deps}
|
||||||
14
src/main.cpp
14
src/main.cpp
|
|
@ -2,10 +2,22 @@
|
||||||
#include <WiFiManager.h>
|
#include <WiFiManager.h>
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
#include <esp32.h>
|
#if (JAJ_BOARD_TARGET == BOARD_ESP32_C3)
|
||||||
|
#include <esp32c3.h>
|
||||||
|
#define BOARD "ESP32C3"
|
||||||
|
#elif (JAJ_BOARD_TARGET == BOARD_ESP32_DEV)
|
||||||
|
#include <esp32.h>
|
||||||
|
#define BOARD "ESP32"
|
||||||
|
#endif
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include <HTTPClient.h>
|
#include <HTTPClient.h>
|
||||||
#elif defined(ARDUINO_ARCH_ESP8266)
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||||
|
#if (JAJ_BOARD_TARGET == BOARD_ESP8266_HUZZAH)
|
||||||
|
#define BOARD "ESP8266-Huzzah"
|
||||||
|
#elif (JAJ_BOARD_TARGET == BOARD_ESP8266_DEV)
|
||||||
|
#define BOARD "ESP8266-DevKit"
|
||||||
|
#endif
|
||||||
|
#include <esp8266.h>
|
||||||
#include <esp8266.h>
|
#include <esp8266.h>
|
||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
#include <ESP8266HTTPClient.h>
|
#include <ESP8266HTTPClient.h>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user