mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
Сделал сборку для esp32s2 (Wemos S2 mini)
This commit is contained in:
15
src/Main.cpp
15
src/Main.cpp
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user