mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
ESP32 target
This commit is contained in:
@@ -15,6 +15,9 @@ class FSEditor : public AsyncWebHandler {
|
||||
bool _authenticated;
|
||||
uint32_t _startTime;
|
||||
|
||||
private:
|
||||
void getDirList(const String& path, String& output);
|
||||
|
||||
public:
|
||||
#ifdef ESP32
|
||||
FSEditor(const fs::FS& fs, const String& username = String(), const String& password = String());
|
||||
@@ -24,5 +27,7 @@ class FSEditor : public AsyncWebHandler {
|
||||
virtual bool canHandle(AsyncWebServerRequest* request) override final;
|
||||
virtual void handleRequest(AsyncWebServerRequest* request) override final;
|
||||
virtual void handleUpload(AsyncWebServerRequest* request, const String& filename, size_t index, uint8_t* data, size_t len, bool final) override final;
|
||||
virtual bool isRequestHandlerTrivial() override final { return false; }
|
||||
virtual bool isRequestHandlerTrivial() override final {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "Global.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#ifdef SSDP_EN
|
||||
extern void SsdpInit();
|
||||
extern String xmlNode(String tags, String data);
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#ifdef ESP8266
|
||||
#include <Servo.h>
|
||||
#else
|
||||
#include <ESP32Servo.h>
|
||||
#endif
|
||||
|
||||
struct Servo_t {
|
||||
uint8_t num;
|
||||
|
||||
@@ -16,21 +16,19 @@ class SensorAnalogClass : public SensorConvertingClass {
|
||||
}
|
||||
|
||||
int SensorAnalogRead(String key, String pin) {
|
||||
int pinInt = pin.toInt();
|
||||
int value;
|
||||
|
||||
#ifdef ESP32
|
||||
int pinInt = pin.toInt();
|
||||
value = analogRead(pinInt);
|
||||
#endif
|
||||
#ifdef ESP8266
|
||||
value = analogRead(A0);
|
||||
#endif
|
||||
|
||||
value = this->mapping(key, value);
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
Serial.println("I sensor '" + key + "' data: " + String(valueFl));
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user