From 263da7a680843adc658973e86bf978b5e2072549 Mon Sep 17 00:00:00 2001 From: Paul Vakhrushev <348009+vahron@users.noreply.github.com> Date: Sun, 28 Feb 2021 21:47:00 +0000 Subject: [PATCH] [platformio] Align configs with Arduino IDE --- firmware/GyverLamp2/GyverLamp2.ino | 4 ++-- firmware/GyverLamp2/data.h | 2 +- firmware/PlatformIO/.gitignore | 1 + firmware/PlatformIO/.vscode/settings.json | 10 ++++++++++ firmware/PlatformIO/README | 7 ------- firmware/PlatformIO/README.md | 23 +++++++++++++++++++++++ firmware/PlatformIO/platformio.ini | 20 ++++++++++++++++++-- 7 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 firmware/PlatformIO/.vscode/settings.json delete mode 100644 firmware/PlatformIO/README create mode 100644 firmware/PlatformIO/README.md diff --git a/firmware/GyverLamp2/GyverLamp2.ino b/firmware/GyverLamp2/GyverLamp2.ino index e520cfc..3dd1704 100644 --- a/firmware/GyverLamp2/GyverLamp2.ino +++ b/firmware/GyverLamp2/GyverLamp2.ino @@ -88,7 +88,7 @@ const char WiFiPassword[] = "12345678"; // ------------ Прочее ------------- #define GL_VERSION 017 // код версии прошивки #define EE_TOUT 30000 // таймаут сохранения епром после изменения, мс -//#define DEBUG_SERIAL // закомментируй чтобы выключить отладку (скорость 115200) +//#define DEBUG_SERIAL_LAMP // закомментируй чтобы выключить отладку (скорость 115200) #define EE_KEY 55 // ключ сброса WiFi (измени для сброса всех настроек) #define NTP_UPD_PRD 5 // период обновления времени с NTP сервера, минут //#define SKIP_WIFI // пропустить подключение к вафле (для отладки) @@ -152,7 +152,7 @@ void blink8(CRGB color); void setup() { delay(2000); // ждём старта есп memset(matrixValue, 0, sizeof(matrixValue)); -#ifdef DEBUG_SERIAL +#ifdef DEBUG_SERIAL_LAMP Serial.begin(115200); DEBUGLN(); #endif diff --git a/firmware/GyverLamp2/data.h b/firmware/GyverLamp2/data.h index f8b3beb..5dbaff0 100644 --- a/firmware/GyverLamp2/data.h +++ b/firmware/GyverLamp2/data.h @@ -19,7 +19,7 @@ #define MAX_PRESETS 40 // макс количество режимов // ------------------- МАКРО -------------------- -#ifdef DEBUG_SERIAL +#ifdef DEBUG_SERIAL_LAMP #define DEBUGLN(x) Serial.println(x) #define DEBUG(x) Serial.print(x) #else diff --git a/firmware/PlatformIO/.gitignore b/firmware/PlatformIO/.gitignore index 89cc49c..cb94ba1 100644 --- a/firmware/PlatformIO/.gitignore +++ b/firmware/PlatformIO/.gitignore @@ -1,3 +1,4 @@ +.DS_Store .pio .vscode/.browse.c_cpp.db* .vscode/c_cpp_properties.json diff --git a/firmware/PlatformIO/.vscode/settings.json b/firmware/PlatformIO/.vscode/settings.json new file mode 100644 index 0000000..0fb2a0f --- /dev/null +++ b/firmware/PlatformIO/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "files.associations": { + "*.tcc": "cpp", + "deque": "cpp", + "list": "cpp", + "string": "cpp", + "unordered_map": "cpp", + "vector": "cpp" + } +} \ No newline at end of file diff --git a/firmware/PlatformIO/README b/firmware/PlatformIO/README deleted file mode 100644 index 87c055f..0000000 --- a/firmware/PlatformIO/README +++ /dev/null @@ -1,7 +0,0 @@ -PIO project - -pio update -pio run --target erase -pio run --target upload - - diff --git a/firmware/PlatformIO/README.md b/firmware/PlatformIO/README.md new file mode 100644 index 0000000..2b91696 --- /dev/null +++ b/firmware/PlatformIO/README.md @@ -0,0 +1,23 @@ +# PIO project + +### Prerequisites: +``` +pio update +``` + +### Update over wire: +``` +pio run -e debug -t erase +pio run -e debug -t upload +pio run -e release -t upload +``` + +### Listen to serial monitor: +``` +pio device monitor +``` + +### Update over local network: +``` +pio run -e wireless -t upload +``` diff --git a/firmware/PlatformIO/platformio.ini b/firmware/PlatformIO/platformio.ini index 0b99a85..c3e6650 100644 --- a/firmware/PlatformIO/platformio.ini +++ b/firmware/PlatformIO/platformio.ini @@ -8,9 +8,25 @@ ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html -[env:esp8266] +[platformio] +default_envs = debug + +[env] platform = espressif8266 -board = esp12e +board = d1_mini +board_build.ldscript = eagle.flash.4m2m.ld +board_build.flash_mode = dout framework = arduino upload_speed = 460800 +monitor_speed = 115200 lib_deps = fastled/FastLED@^3.4.0 + +[env:release] + +[env:debug] +build_type = debug +build_flags = -D DEBUG_SERIAL_LAMP + +[env:wireless] +upload_protocol = espota +upload_port = 192.168.8.164