Skip to content

Tasmota changes #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/install-arduino-core-esp32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
ln -s $GITHUB_WORKSPACE esp32
else
echo "Cloning Core Repository..."
git clone https://github.com/espressif/arduino-esp32.git esp32 > /dev/null 2>&1
git clone https://github.com/tasmota/arduino-esp32.git esp32 > /dev/null 2>&1
fi

#echo "Updating Submodules ..."
Expand Down
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ set(LIBRARY_SRCS
libraries/I2S/src/I2S.cpp
libraries/NetBIOS/src/NetBIOS.cpp
libraries/Preferences/src/Preferences.cpp
libraries/RainMaker/src/RMaker.cpp
libraries/RainMaker/src/RMakerNode.cpp
libraries/RainMaker/src/RMakerParam.cpp
libraries/RainMaker/src/RMakerDevice.cpp
libraries/RainMaker/src/RMakerType.cpp
libraries/SD_MMC/src/SD_MMC.cpp
libraries/SD/src/SD.cpp
libraries/SD/src/sd_diskio.cpp
Expand Down Expand Up @@ -184,7 +179,6 @@ set(includedirs
libraries/I2S/src
libraries/NetBIOS/src
libraries/Preferences/src
libraries/RainMaker/src
libraries/SD_MMC/src
libraries/SD/src
libraries/SimpleBLE/src
Expand Down Expand Up @@ -239,10 +233,6 @@ endfunction()

maybe_add_component(esp-dsp)

if(CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK)
maybe_add_component(esp_rainmaker)
maybe_add_component(qrcode)
endif()
if(IDF_TARGET MATCHES "esp32s2|esp32s3" AND CONFIG_TINYUSB_ENABLED)
maybe_add_component(arduino_tinyusb)
endif()
Expand Down
14 changes: 9 additions & 5 deletions cores/esp32/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extern "C" {
#elif CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/rom/spi_flash.h"
#define ESP_FLASH_IMAGE_BASE 0x0000 // Esp32c3 is located at 0x0000
#else
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
Expand Down Expand Up @@ -192,7 +192,7 @@ static uint32_t sketchSize(sketchSize_t response) {
return data.image_len;
}
}

uint32_t EspClass::getSketchSize () {
return sketchSize(SKETCH_SIZE_TOTAL);
}
Expand Down Expand Up @@ -231,6 +231,10 @@ String EspClass::getSketchMD5()
md5.add(buf.get(), readBytes);
lengthLeft -= readBytes;
offset += readBytes;

#if CONFIG_FREERTOS_UNICORE
delay(1); // Fix solo WDT
#endif
}
md5.calculate();
result = md5.toString();
Expand Down Expand Up @@ -391,17 +395,17 @@ bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
return spi_flash_read(offset, (uint32_t*) data, size) == ESP_OK;
}

bool EspClass::partitionEraseRange(const esp_partition_t *partition, uint32_t offset, size_t size)
bool EspClass::partitionEraseRange(const esp_partition_t *partition, uint32_t offset, size_t size)
{
return esp_partition_erase_range(partition, offset, size) == ESP_OK;
}

bool EspClass::partitionWrite(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
bool EspClass::partitionWrite(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
{
return esp_partition_write(partition, offset, data, size) == ESP_OK;
}

bool EspClass::partitionRead(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
bool EspClass::partitionRead(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
{
return esp_partition_read(partition, offset, data, size) == ESP_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP32/examples/RMT/RMTCallback/RMTCallback.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ void loop()
{
Serial.printf("GPIO 4: %08x 5: %08x 10: %08x\n", mp1.val(), mp2.val(), mp3.val());
delay(500);
}
}
26 changes: 1 addition & 25 deletions libraries/FS/src/vfs_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@
// limitations under the License.

#include "vfs_api.h"
#include <stdio_ext.h>

using namespace fs;

#define READ_SIZE_SWITCH 128 //swithc to read func when read size > 128bytes

FileImplPtr VFSImpl::open(const char* fpath, const char* mode, const bool create)
{
if(!_mountpoint) {
Expand Down Expand Up @@ -377,28 +374,7 @@ size_t VFSFileImpl::read(uint8_t* buf, size_t size)
return 0;
}

//ERASE BYTEBUFFER and use read when size > READ_SIZE_SWITCH always
if(size > READ_SIZE_SWITCH)
{
//check some data in buffer exists –> clear buffer and move pointer to deleted data
size_t bytesinbuf = __fpending(_f);
if (bytesinbuf && (bytesinbuf != 128)) //buffer lenght is 128 bytes
{
fpurge(_f);
lseek(fileno(_f),(-128+bytesinbuf),SEEK_CUR);
}

int res = ::read(fileno(_f), buf, size);
if (res < 0) {
// an error occurred
return 0;
}
return res;
}
else
{
return fread(buf, 1, size, _f);
}
return fread(buf, 1, size, _f);
}

void VFSFileImpl::flush()
Expand Down
3 changes: 0 additions & 3 deletions libraries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec
### Preferences
Flash keystore using ESP32 NVS

### ESP RainMaker
End-to-end platform by Espressif that enables Makers to realize their IoT ideas faster

### SD
Secure Digital card filesystem using SPI access

Expand Down
Loading