feat: add task handles for BambuMqttTask and ScaleTask; rename stopTasks to stopAllTasks
This commit is contained in:
parent
4475d21218
commit
6f24630a7d
@ -36,4 +36,5 @@ void mqtt_loop(void * parameter);
|
|||||||
bool setBambuSpool(String payload);
|
bool setBambuSpool(String payload);
|
||||||
void bambu_restart();
|
void bambu_restart();
|
||||||
|
|
||||||
|
extern TaskHandle_t BambuMqttTask;
|
||||||
#endif
|
#endif
|
||||||
|
13
src/ota.cpp
13
src/ota.cpp
@ -3,14 +3,20 @@
|
|||||||
#include <Update.h>
|
#include <Update.h>
|
||||||
#include <SPIFFS.h>
|
#include <SPIFFS.h>
|
||||||
#include "commonFS.h"
|
#include "commonFS.h"
|
||||||
|
#include "bambu.h"
|
||||||
|
#include "scale.h"
|
||||||
|
#include "nfc.h"
|
||||||
|
|
||||||
// Magic byte patterns für verschiedene Image-Typen
|
// Magic byte patterns für verschiedene Image-Typen
|
||||||
const uint8_t FIRMWARE_MAGIC = 0xE9;
|
const uint8_t FIRMWARE_MAGIC = 0xE9;
|
||||||
const uint8_t ESP_MAGIC = 0xE9;
|
const uint8_t ESP_MAGIC = 0xE9;
|
||||||
|
|
||||||
void stopTasks() {
|
void stopAllTasks() {
|
||||||
// Stop all tasks
|
// Stop all tasks
|
||||||
vTaskSuspend(NULL);
|
vTaskSuspend(NfcTask);
|
||||||
|
vTaskSuspend(BambuMqttTask);
|
||||||
|
vTaskSuspend(ScaleTask);
|
||||||
|
//vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleOTAUpload(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {
|
void handleOTAUpload(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {
|
||||||
@ -21,8 +27,7 @@ void handleOTAUpload(AsyncWebServerRequest *request, String filename, size_t ind
|
|||||||
static size_t spiffsSize = 0;
|
static size_t spiffsSize = 0;
|
||||||
static const uint32_t SPIFFS_START = 0x310000; // SPIFFS start in full.bin
|
static const uint32_t SPIFFS_START = 0x310000; // SPIFFS start in full.bin
|
||||||
|
|
||||||
stopTasks();
|
stopAllTasks();
|
||||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
|
||||||
|
|
||||||
if (!index) {
|
if (!index) {
|
||||||
// Reset static variables
|
// Reset static variables
|
||||||
|
@ -15,4 +15,6 @@ extern uint8_t weigthCouterToApi;
|
|||||||
extern uint8_t scale_tare_counter;
|
extern uint8_t scale_tare_counter;
|
||||||
extern uint8_t pauseMainTask;
|
extern uint8_t pauseMainTask;
|
||||||
|
|
||||||
|
extern TaskHandle_t ScaleTask;
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
x
Reference in New Issue
Block a user