Сделал сборку для esp32s2 (Wemos S2 mini)

This commit is contained in:
Mit4el
2023-05-27 02:02:33 +03:00
parent f8de34fb97
commit 3b1eb07d74
9 changed files with 92 additions and 7 deletions

View File

@@ -3,6 +3,9 @@
#include "classes/IoTDB.h"
#include "utils/Statistic.h"
#include <Wire.h>
#ifdef esp32s2_4mb
#include <USB.h>
#endif
IoTScenario iotScen; // объект управления сценарием
@@ -66,14 +69,14 @@ void IRAM_ATTR onTimer(){
#endif
void initErrorMarker(int id) {
#ifdef esp32_4mb
#ifdef esp32_4mb
initErrorMarkerId = id;
errorMarkerCounter = 0;
#endif
}
void stopErrorMarker(int id) {
#ifdef esp32_4mb
#ifdef esp32_4mb
errorMarkerCounter = -1;
if (errorMarkerId)
SerialPrint("I", "WARNING!", "A lazy (freezing loop more than " + (String)(COUNTER_ERRORMARKER * STEPPER_ERRORMARKER / 1000) + " ms) section has been found! With ID=" + (String)errorMarkerId);
@@ -85,8 +88,10 @@ void stopErrorMarker(int id) {
void setup() {
#ifdef esp32_4mb
#ifdef esp32s2_4mb
USB.begin();
#endif
#ifdef esp32_4mb
My_timer = timerBegin(0, 80, true);
timerAttachInterrupt(My_timer, &onTimer, true);
timerAlarmWrite(My_timer, STEPPER_ERRORMARKER, true);
@@ -129,7 +134,7 @@ void setup() {
jsonRead(settingsFlashJson, "i2cFreq", i2cFreq, false);
jsonRead(settingsFlashJson, "i2c", i2c, false);
if (i2c != 0) {
#ifdef esp32_4mb
#ifdef ESP32
Wire.end();
Wire.begin(pinSDA, pinSCL, (uint32_t)i2cFreq);
#else