mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-05 13:00:42 +08:00
Fix upload on SDIO subdir failed due to subdirectory is not detected properly
Fix typo in DHT module Move disable brown out dector to Hal::begin
This commit is contained in:
parent
4227db2947
commit
7cf4b881fd
@ -24,6 +24,8 @@
|
||||
#include "ESP8266WiFi.h"
|
||||
#endif //ARDUINO_ARCH_ESP8266
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#include <soc/soc.h>
|
||||
#include <soc/rtc_cntl_reg.h>
|
||||
#include "WiFi.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -183,6 +185,10 @@ void Hal::analogWriteRange(uint32_t range)
|
||||
//Setup
|
||||
bool Hal::begin()
|
||||
{
|
||||
#if defined(ARDUINO_ARCH_ESP32) && defined(CAMERA_DEVICE)
|
||||
log_esp3d("Disable brown out");
|
||||
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
|
||||
#endif //ARDUINO_ARCH_ESP32 && CAMERA_DEVICE
|
||||
//Clear all wifi state
|
||||
WiFi.persistent(false);
|
||||
WiFi.disconnect(true);
|
||||
|
@ -22,7 +22,7 @@
|
||||
#define _VERSION_ESP3D_H
|
||||
|
||||
//version and sources location
|
||||
#define FW_VERSION "3.0.0.a52"
|
||||
#define FW_VERSION "3.0.0.a53"
|
||||
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
|
||||
|
||||
#endif //_VERSION_ESP3D_H
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "esp_http_server.h"
|
||||
#include <esp_camera.h>
|
||||
#include "fd_forward.h"
|
||||
//#include <soc/soc.h> //not sure this one is needed
|
||||
#include <soc/soc.h> //not sure this one is needed
|
||||
#include <soc/rtc_cntl_reg.h>
|
||||
#include <driver/i2c.h>
|
||||
|
||||
|
@ -148,10 +148,12 @@ ESP_SDFile ESP_SD::open(const char* path, uint8_t mode)
|
||||
{
|
||||
//do some check
|
||||
if(((strcmp(path,"/") == 0) && ((mode == ESP_FILE_WRITE) || (mode == ESP_FILE_APPEND))) || (strlen(path) == 0)) {
|
||||
log_esp3d("File open check : failed");
|
||||
return ESP_SDFile();
|
||||
}
|
||||
// path must start by '/'
|
||||
if (path[0] != '/') {
|
||||
log_esp3d("File open path is invalid");
|
||||
return ESP_SDFile();
|
||||
}
|
||||
if (mode != ESP_FILE_READ) {
|
||||
@ -159,7 +161,7 @@ ESP_SDFile ESP_SD::open(const char* path, uint8_t mode)
|
||||
String p = path;
|
||||
p.remove(p.lastIndexOf('/') +1);
|
||||
if (!exists(p.c_str())) {
|
||||
log_esp3d("Error opening: %s", path);
|
||||
log_esp3d("Error opening: %s, %s does not exists", path,p.c_str());
|
||||
return ESP_SDFile();
|
||||
}
|
||||
}
|
||||
@ -171,13 +173,18 @@ ESP_SDFile ESP_SD::open(const char* path, uint8_t mode)
|
||||
bool ESP_SD::exists(const char* path)
|
||||
{
|
||||
bool res = false;
|
||||
String p = path;
|
||||
//root should always be there if started
|
||||
if (strcmp(path, "/") == 0) {
|
||||
if (p == "/") {
|
||||
return _started;
|
||||
}
|
||||
res = SD_MMC.exists(path);
|
||||
|
||||
if (p.endsWith("/")) {
|
||||
p.remove( p.length() - 1,1);
|
||||
}
|
||||
res = SD_MMC.exists(p);
|
||||
if (!res) {
|
||||
ESP_SDFile root = ESP_SD::open(path, ESP_FILE_READ);
|
||||
ESP_SDFile root = ESP_SD::open(p.c_str(), ESP_FILE_READ);
|
||||
if (root) {
|
||||
res = root.isDirectory();
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ const char * DHTSensorDevice::GetData()
|
||||
if ( String(humidity,1)!="nan") {
|
||||
s= String(temperature,1);
|
||||
s+= "[";
|
||||
s+= SENSOR__UNIT+
|
||||
s+= SENSOR__UNIT;
|
||||
s+="] " + String(humidity,1) + "[%]";
|
||||
} else {
|
||||
s="DISCONNECTED";
|
||||
|
Loading…
x
Reference in New Issue
Block a user