@alteriom/painlessmesh 1.7.3 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -0
- package/docs/releases/PATCH_v1.7.2.md +262 -0
- package/docs/releases/PATCH_v1.7.4.md +219 -0
- package/docs/releases/RELEASE_CHECKLIST_v1.7.4.md +253 -0
- package/docs/releases/RELEASE_SUMMARY_v1.7.4.md +276 -0
- package/docs/releases/RELEASE_SUMMARY_v1.7.5.md +322 -0
- package/docs/troubleshooting/CRASH_QUICK_REF.md +93 -0
- package/docs/troubleshooting/FREERTOS_ASSERTION_FAILURE.md +288 -0
- package/docs/troubleshooting/FREERTOS_FIX_IMPLEMENTATION.md +267 -0
- package/docs/troubleshooting/QUICK_FIX_FREERTOS.md +164 -0
- package/docs/troubleshooting/SENSOR_NODE_CONNECTION_CRASH.md +264 -0
- package/examples/alteriom/platformio.ini +1 -0
- package/examples/alteriomImproved/improved_sensor_node.ino +2 -0
- package/examples/alteriomImproved/platformio.ini +7 -0
- package/examples/alteriomPhase1/platformio.ini +1 -0
- package/examples/alteriomPhase2/platformio.ini +1 -0
- package/examples/alteriomSensorNode/alteriom_sensor_node.ino +2 -0
- package/examples/alteriomSensorNode/platformio.ini +1 -0
- package/examples/basic/platformio.ini +1 -0
- package/examples/bridge/platformio.ini +1 -0
- package/examples/echoNode/platformio.ini +1 -0
- package/examples/logClient/platformio.ini +1 -0
- package/examples/logServer/platformio.ini +1 -0
- package/examples/meshCommandNode/meshCommandNode.ino +2 -0
- package/examples/meshCommandNode/platformio.ini +1 -0
- package/examples/mqttBridge/platformio.ini +1 -0
- package/examples/mqttCommandBridge/mesh_event_publisher.hpp +19 -19
- package/examples/mqttCommandBridge/mesh_topology_reporter.hpp +18 -18
- package/examples/mqttCommandBridge/mqttCommandBridge.ino +3 -1
- package/examples/mqttCommandBridge/mqtt_command_bridge.hpp +9 -6
- package/examples/mqttCommandBridge/platformio.ini +1 -0
- package/examples/mqttStatusBridge/mqttStatusBridge.ino +2 -0
- package/examples/mqttStatusBridge/platformio.ini +1 -0
- package/examples/mqttTopologyTest/mqttTopologyTest.ino +2 -0
- package/examples/mqttTopologyTest/platformio.ini +1 -0
- package/examples/namedMesh/platformio.ini +1 -0
- package/examples/otaReceiver/platformio.ini +1 -0
- package/examples/otaSender/platformio.ini +1 -0
- package/examples/startHere/platformio.ini +1 -0
- package/examples/webServer/platformio.ini +1 -0
- package/library.json +1 -1
- package/library.properties +1 -1
- package/package.json +1 -1
- package/src/painlessTaskOptions.h +18 -3
- package/src/painlessmesh/mesh.hpp +12 -1
- package/src/painlessmesh/scheduler_queue.cpp +77 -0
- package/src/painlessmesh/scheduler_queue.hpp +34 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#include "painlessmesh/scheduler_queue.hpp"
|
|
2
|
+
|
|
3
|
+
#ifdef ESP32
|
|
4
|
+
|
|
5
|
+
namespace painlessmesh {
|
|
6
|
+
namespace scheduler {
|
|
7
|
+
|
|
8
|
+
// Global queue handle for TaskScheduler thread-safe operations
|
|
9
|
+
QueueHandle_t tsQueue = NULL;
|
|
10
|
+
|
|
11
|
+
bool initQueue() {
|
|
12
|
+
if (tsQueue != NULL) {
|
|
13
|
+
return true; // Already initialized
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
tsQueue = xQueueCreate(TS_QUEUE_LEN, sizeof(_task_request_t));
|
|
17
|
+
return (tsQueue != NULL);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
} // namespace scheduler
|
|
21
|
+
} // namespace painlessmesh
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Enqueue a task request (called from any thread/ISR)
|
|
25
|
+
* This function is required when _TASK_THREAD_SAFE is enabled
|
|
26
|
+
*
|
|
27
|
+
* Overrides the weak default implementation in TaskScheduler.h
|
|
28
|
+
*/
|
|
29
|
+
bool _task_enqueue_request(_task_request_t* req) {
|
|
30
|
+
using namespace painlessmesh::scheduler;
|
|
31
|
+
|
|
32
|
+
if (tsQueue == NULL) {
|
|
33
|
+
return false; // Queue not initialized
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (xPortInIsrContext()) {
|
|
37
|
+
// Called from ISR context
|
|
38
|
+
BaseType_t xHigherPriorityTaskWokenByPost = pdFALSE;
|
|
39
|
+
BaseType_t rc = xQueueSendFromISR(tsQueue, req, &xHigherPriorityTaskWokenByPost);
|
|
40
|
+
if (xHigherPriorityTaskWokenByPost) {
|
|
41
|
+
portYIELD_FROM_ISR();
|
|
42
|
+
}
|
|
43
|
+
return (rc == pdTRUE);
|
|
44
|
+
} else {
|
|
45
|
+
// Called from normal task context
|
|
46
|
+
return (xQueueSend(tsQueue, req, pdMS_TO_TICKS(TS_ENQUEUE_WAIT_MS)) == pdTRUE);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Dequeue a task request (called by scheduler)
|
|
52
|
+
* This function is required when _TASK_THREAD_SAFE is enabled
|
|
53
|
+
*
|
|
54
|
+
* Overrides the weak default implementation in TaskScheduler.h
|
|
55
|
+
*/
|
|
56
|
+
bool _task_dequeue_request(_task_request_t* req) {
|
|
57
|
+
using namespace painlessmesh::scheduler;
|
|
58
|
+
|
|
59
|
+
if (tsQueue == NULL) {
|
|
60
|
+
return false; // Queue not initialized
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (xPortInIsrContext()) {
|
|
64
|
+
// Called from ISR context (shouldn't normally happen)
|
|
65
|
+
BaseType_t xHigherPriorityTaskWokenByPost = pdFALSE;
|
|
66
|
+
BaseType_t rc = xQueueReceiveFromISR(tsQueue, req, &xHigherPriorityTaskWokenByPost);
|
|
67
|
+
if (xHigherPriorityTaskWokenByPost) {
|
|
68
|
+
portYIELD_FROM_ISR();
|
|
69
|
+
}
|
|
70
|
+
return (rc == pdTRUE);
|
|
71
|
+
} else {
|
|
72
|
+
// Called from normal task context
|
|
73
|
+
return (xQueueReceive(tsQueue, req, TS_DEQUEUE_WAIT_MS) == pdTRUE);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#endif // ESP32
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#ifndef _PAINLESSMESH_SCHEDULER_QUEUE_HPP_
|
|
2
|
+
#define _PAINLESSMESH_SCHEDULER_QUEUE_HPP_
|
|
3
|
+
|
|
4
|
+
#ifdef ESP32
|
|
5
|
+
|
|
6
|
+
#include <freertos/FreeRTOS.h>
|
|
7
|
+
#include <freertos/queue.h>
|
|
8
|
+
#include <TaskSchedulerDeclarations.h>
|
|
9
|
+
|
|
10
|
+
namespace painlessmesh {
|
|
11
|
+
namespace scheduler {
|
|
12
|
+
|
|
13
|
+
// Configuration constants
|
|
14
|
+
constexpr size_t TS_QUEUE_LEN = 16; // Task request queue length
|
|
15
|
+
constexpr TickType_t TS_ENQUEUE_WAIT_MS = 10; // Max wait for enqueue (ms)
|
|
16
|
+
constexpr TickType_t TS_DEQUEUE_WAIT_MS = 0; // No wait for dequeue
|
|
17
|
+
|
|
18
|
+
// Global queue handle (initialized in mesh init)
|
|
19
|
+
extern QueueHandle_t tsQueue;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Initialize the TaskScheduler request queue
|
|
23
|
+
* Must be called during mesh initialization on ESP32
|
|
24
|
+
*
|
|
25
|
+
* @return true if queue created successfully, false otherwise
|
|
26
|
+
*/
|
|
27
|
+
bool initQueue();
|
|
28
|
+
|
|
29
|
+
} // namespace scheduler
|
|
30
|
+
} // namespace painlessmesh
|
|
31
|
+
|
|
32
|
+
#endif // ESP32
|
|
33
|
+
|
|
34
|
+
#endif // _PAINLESSMESH_SCHEDULER_QUEUE_HPP_
|