mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-09-25 13:53:41 +00:00
Share T096 Full mOTA memory with the offline queue
This commit is contained in:
+22
-2
@@ -4,6 +4,16 @@
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
#include <string.h>
|
||||
#include <helpers/nrf52/BleTaskStartup.h>
|
||||
|
||||
namespace mesh {
|
||||
namespace nrf52 {
|
||||
static uint8_t ble_task_mask;
|
||||
|
||||
void resetBleTaskStartup() { ble_task_mask = 0; }
|
||||
bool bleTasksStarted() { return ble_task_mask == 3; }
|
||||
} // namespace nrf52
|
||||
} // namespace mesh
|
||||
|
||||
#ifndef MESH_NRF52_LOOP_STACK_WORDS
|
||||
#define MESH_NRF52_LOOP_STACK_WORDS 2048
|
||||
@@ -32,8 +42,18 @@ extern "C" BaseType_t __wrap_xTaskCreate(
|
||||
&& stack_depth == 1024) {
|
||||
adjusted_depth = MESH_NRF52_LOOP_STACK_WORDS;
|
||||
}
|
||||
return __real_xTaskCreate(task_code, task_name, adjusted_depth, parameters,
|
||||
priority, created_task);
|
||||
const BaseType_t result = __real_xTaskCreate(
|
||||
task_code, task_name, adjusted_depth, parameters, priority, created_task);
|
||||
if (task_name != NULL) {
|
||||
const uint8_t mask = strcmp(task_name, "BLE") == 0 ? 1
|
||||
: strcmp(task_name, "SOC") == 0 ? 2 : 0;
|
||||
if (result == pdPASS) {
|
||||
mesh::nrf52::ble_task_mask |= mask;
|
||||
} else {
|
||||
mesh::nrf52::ble_task_mask &= ~mask;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user