mirror of
https://github.com/luc-github/ESP3DLib.git
synced 2026-02-20 01:11:22 +01:00
Dev (#16)
* Fix OTA size calculation wrong on big flash * Simplify wait function * Reduce ESP3DLib memory in task * Fix no compilation with latest bugfix * really test commit during travis test
This commit is contained in:
@@ -19,8 +19,10 @@ install:
|
||||
|
||||
before_script:
|
||||
- platformio update
|
||||
- cd $TRAVIS_BUILD_DIR
|
||||
- git clone -b bugfix-2.0.x https://github.com/MarlinFirmware/Marlin.git Marlin
|
||||
- cd Marlin
|
||||
- sed -i "s/default_envs = mega2560/default_envs = esp32/g" ./platformio.ini
|
||||
- sed -i "s/#define WIFISUPPORT/\/\/#define WIFISUPPORT/g" ./Marlin/Configuration_adv.h
|
||||
- sed -i "s/\/\/#define ESP3D_WIFISUPPORT/#define ESP3D_WIFISUPPORT/g" ./Marlin/Configuration_adv.h
|
||||
- sed -i "s/\/\/#define WEBSUPPORT/#define WEBSUPPORT/g" ./Marlin/Configuration_adv.h
|
||||
@@ -28,8 +30,12 @@ before_script:
|
||||
- sed -i "s/\/\/#define CUSTOM_COMMAND/#define CUSTOM_COMMAND/g" ./Marlin/Configuration_adv.h
|
||||
- sed -i "s/#define MOTHERBOARD BOARD_RAMPS_14_EFB/#define MOTHERBOARD BOARD_MRR_ESPE/g" ./Marlin/Configuration.h
|
||||
- cat ./Marlin/Configuration.h
|
||||
- cp $TRAVIS_BUILD_DIR/extra_script.py .
|
||||
script:
|
||||
- platformio run -e esp32
|
||||
- platformio run -e esp32 || true
|
||||
- rm -fr $TRAVIS_BUILD_DIR/Marlin/.pio/libdeps/esp32/ESP3DLib/src
|
||||
- cp -r $TRAVIS_BUILD_DIR/src $TRAVIS_BUILD_DIR/Marlin/.pio/libdeps/esp32/ESP3DLib/
|
||||
- platformio run -e esp32
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
||||
4
extra_script.py
Normal file
4
extra_script.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import shutil
|
||||
shutil.rmtree("$TRAVIS_BUILD_DIR/Marlin/.pio/libdeps/esp32/ESP3DLib/src")
|
||||
shutil.copytree("$TRAVIS_BUILD_DIR/src", "$TRAVIS_BUILD_DIR/Marlin/.pio/libdeps/esp32/ESP3DLib/")
|
||||
print("Update ESP3DLib files")
|
||||
@@ -1,5 +1,5 @@
|
||||
name=ESP3DLib
|
||||
version=1.0.0
|
||||
version=1.0.8
|
||||
author=Luc Lebosse
|
||||
maintainer=Luc Lebosse, <support@tech-hunters.com>
|
||||
sentence=A 3D printer front end for ESP boards.
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <WebServer.h>
|
||||
#endif //HTTP_FEATURE
|
||||
#include "serial2socket.h"
|
||||
#include <esp_ota_ops.h>
|
||||
#include MARLIN_PATH(inc/Version.h)
|
||||
|
||||
String COMMAND::get_param (String & cmd_params, const char * id, bool withspace)
|
||||
@@ -1208,12 +1209,18 @@ bool COMMAND::execute_internal_command (int cmd, String cmd_params, level_authen
|
||||
espresponse->print (ESPResponseStream::formatBytes (ESP.getFlashChipSize()).c_str());
|
||||
espresponse->print ("\n");
|
||||
espresponse->print ("Available Size for update: ");
|
||||
//Not OTA on 2Mb board per spec
|
||||
if (ESP.getFlashChipSize() > 0x20000) {
|
||||
espresponse->print (ESPResponseStream::formatBytes (0x140000).c_str());
|
||||
} else {
|
||||
espresponse->print (ESPResponseStream::formatBytes (0x0).c_str());
|
||||
size_t flashsize = 0;
|
||||
const esp_partition_t* mainpartition = esp_ota_get_running_partition();
|
||||
if (mainpartition) {
|
||||
const esp_partition_t* partition = esp_ota_get_next_update_partition(mainpartition);
|
||||
if (partition) {
|
||||
const esp_partition_t* partition2 = esp_ota_get_next_update_partition(partition);
|
||||
if (partition2 && (partition->address!=partition2->address)) {
|
||||
flashsize = partition2->size;
|
||||
}
|
||||
}
|
||||
}
|
||||
espresponse->print (ESPResponseStream::formatBytes (flashsize).c_str());
|
||||
espresponse->print ("\n");
|
||||
espresponse->print ("Available Size for SPIFFS: ");
|
||||
espresponse->print (ESPResponseStream::formatBytes (SPIFFS.totalBytes()).c_str());
|
||||
|
||||
@@ -58,11 +58,11 @@ void Esp3DLib::init()
|
||||
xTaskCreatePinnedToCore(
|
||||
ESP3DLibTaskfn, /* Task function. */
|
||||
"ESP3DLib Task", /* name of task. */
|
||||
10000, /* Stack size of task */
|
||||
8192, /* Stack size of task */
|
||||
NULL, /* parameter of the task */
|
||||
ESP3DLIB_RUNNING_PRIORITY, /* priority of the task */
|
||||
NULL, /* Task handle to keep track of created task */
|
||||
ESP3DLIB_RUNNING_CORE /* Core to run the task */
|
||||
ESP3DLIB_RUNNING_CORE /* Core to run the task */
|
||||
);
|
||||
}
|
||||
//Parse command
|
||||
|
||||
@@ -38,14 +38,8 @@ bool Esp3DLibConfig::restart_ESP_module = false;
|
||||
*/
|
||||
void Esp3DLibConfig::wait(uint32_t milliseconds)
|
||||
{
|
||||
uint32_t timeout = millis();
|
||||
vTaskDelay(1 / portTICK_RATE_MS); // Yield to other tasks
|
||||
esp_task_wdt_reset(); //for a wait 0;
|
||||
//wait feeding WDT
|
||||
while ( (millis() - timeout) < milliseconds) {
|
||||
esp_task_wdt_reset();
|
||||
vTaskDelay(1 / portTICK_RATE_MS); // Yield to other tasks
|
||||
}
|
||||
vTaskDelay((milliseconds>0?milliseconds:1) / portTICK_RATE_MS); // Yield to other tasks
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,15 +28,15 @@
|
||||
#undef DISABLED
|
||||
#undef _BV
|
||||
//version
|
||||
#define LIB_VERSION "1.0.7"
|
||||
#define LIB_VERSION "1.0.8"
|
||||
|
||||
//Allow to override the default core used by ESP3DLIB
|
||||
#ifndef ESP3DLIB_RUNNING_CORE
|
||||
#ifndef ESP3DLIB_RUNNING_CORE
|
||||
#define ESP3DLIB_RUNNING_CORE 0
|
||||
#endif //ESP3DLIB_RUNNING_CORE
|
||||
|
||||
//Allow to override the default priority task used by ESP3DLIB_RUNNING_PRIORITY
|
||||
#ifndef ESP3DLIB_RUNNING_PRIORITY
|
||||
#ifndef ESP3DLIB_RUNNING_PRIORITY
|
||||
#define ESP3DLIB_RUNNING_PRIORITY 1
|
||||
#endif //ESP3DLIB_RUNNING_PRIORITY
|
||||
|
||||
|
||||
@@ -26,7 +26,16 @@
|
||||
#if HAS_GRAPHICAL_LCD
|
||||
#include <U8glib.h>
|
||||
#endif
|
||||
//for 2.0.x
|
||||
#if defined __has_include
|
||||
#if __has_include (MARLIN_PATH(lcd/ultralcd.h))
|
||||
#include MARLIN_PATH(lcd/ultralcd.h)
|
||||
#endif
|
||||
//for bugfix-2.0.x
|
||||
#if __has_include (MARLIN_PATH(lcd/marlinui.h))
|
||||
#include MARLIN_PATH(lcd/marlinui.h)
|
||||
#endif
|
||||
#endif
|
||||
#include "espcom.h"
|
||||
#if defined(HTTP_FEATURE)
|
||||
#include <WebServer.h>
|
||||
@@ -35,11 +44,13 @@ void Esp3DCom::echo(const char * data)
|
||||
{
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_ECHOLNPAIR("", data);
|
||||
#if HAS_DISPLAY
|
||||
if (strlen(data)) {
|
||||
ui.set_status(data);
|
||||
} else {
|
||||
ui.reset_status();
|
||||
}
|
||||
#endif //HAS_DISPLAY
|
||||
}
|
||||
long ESPResponseStream::baudRate()
|
||||
{
|
||||
|
||||
@@ -1160,10 +1160,14 @@ void Web_Server::WebUpdateUpload ()
|
||||
}
|
||||
//check space
|
||||
size_t flashsize = 0;
|
||||
if (esp_ota_get_running_partition()) {
|
||||
const esp_partition_t* partition = esp_ota_get_next_update_partition(NULL);
|
||||
const esp_partition_t* mainpartition = esp_ota_get_running_partition();
|
||||
if (mainpartition) {
|
||||
const esp_partition_t* partition = esp_ota_get_next_update_partition(mainpartition);
|
||||
if (partition) {
|
||||
flashsize = partition->size;
|
||||
const esp_partition_t* partition2 = esp_ota_get_next_update_partition(partition);
|
||||
if (partition2 && (partition->address!=partition2->address)) {
|
||||
flashsize = partition2->size;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flashsize < maxSketchSpace) {
|
||||
|
||||
Reference in New Issue
Block a user