fix: mutex FreeRTOS buffer historique, découplage LittleFS/REST

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-23 16:43:05 +02:00
parent 29f26c1db4
commit 49c54f4e48
4 changed files with 49 additions and 33 deletions
+10 -5
View File
@@ -1,5 +1,7 @@
#pragma once
#include <Arduino.h>
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
// ── Constantes matérielles ──────────────────────────────────────────
#define ONE_WIRE_BUS 4 // GPIO 4 — bus OneWire DS18B20
@@ -57,8 +59,11 @@ struct NetworkStatus {
};
// ── Déclarations extern (définies dans main.cpp) ────────────────────
extern SondeConfig sondesConfig[NB_SONDES];
extern SondeEtat sondesEtat[NB_SONDES];
extern PointHistorique historique[HIST_TAILLE];
extern uint16_t histIdx;
extern NetworkStatus netStatus;
extern SondeConfig sondesConfig[NB_SONDES];
extern SondeEtat sondesEtat[NB_SONDES];
extern PointHistorique historique[HIST_TAILLE];
extern uint16_t histIdx;
extern NetworkStatus netStatus;
// Mutex FreeRTOS protégeant l'accès concurrent au buffer historique
// (Core 0 : callbacks AsyncWebServer vs Core 1 : loop/sensors_update)
extern SemaphoreHandle_t xHistMutex;