mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-28 01:58:11 -07:00
Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into xfw-dev
This commit is contained in:
+1
-1
@@ -86,7 +86,7 @@ static void __furi_print_stack_info() {
|
||||
}
|
||||
|
||||
static void __furi_print_bt_stack_info() {
|
||||
const FuriHalBtHardfaultInfo* fault_info = furi_hal_bt_get_hardfault_info();
|
||||
const BleGlueHardfaultInfo* fault_info = ble_glue_get_hardfault_info();
|
||||
if(fault_info == NULL) {
|
||||
furi_log_puts("\r\n\tcore2: not faulted");
|
||||
} else {
|
||||
|
||||
+12
-4
@@ -14,6 +14,7 @@
|
||||
#include <furi_hal_rtc.h>
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <stdint.h>
|
||||
#include <task.h>
|
||||
|
||||
#define TAG "FuriThread"
|
||||
@@ -191,6 +192,12 @@ void furi_thread_set_priority(FuriThread* thread, FuriThreadPriority priority) {
|
||||
thread->priority = priority;
|
||||
}
|
||||
|
||||
FuriThreadPriority furi_thread_get_priority(FuriThread* thread) {
|
||||
furi_assert(thread);
|
||||
TaskHandle_t hTask = furi_thread_get_id(thread);
|
||||
return (FuriThreadPriority)uxTaskPriorityGet(hTask);
|
||||
}
|
||||
|
||||
void furi_thread_set_current_priority(FuriThreadPriority priority) {
|
||||
UBaseType_t new_priority = priority ? priority : FuriThreadPriorityNormal;
|
||||
vTaskPrioritySet(NULL, new_priority);
|
||||
@@ -465,22 +472,23 @@ uint32_t furi_thread_flags_wait(uint32_t flags, uint32_t options, uint32_t timeo
|
||||
return (rflags);
|
||||
}
|
||||
|
||||
uint32_t furi_thread_enumerate(FuriThreadId* thread_array, uint32_t array_items) {
|
||||
uint32_t furi_thread_enumerate(FuriThreadId* thread_array, uint32_t array_item_count) {
|
||||
uint32_t i, count;
|
||||
TaskStatus_t* task;
|
||||
|
||||
if(FURI_IS_IRQ_MODE() || (thread_array == NULL) || (array_items == 0U)) {
|
||||
if(FURI_IS_IRQ_MODE() || (thread_array == NULL) || (array_item_count == 0U)) {
|
||||
count = 0U;
|
||||
} else {
|
||||
vTaskSuspendAll();
|
||||
|
||||
count = uxTaskGetNumberOfTasks();
|
||||
task = pvPortMalloc(count * sizeof(TaskStatus_t));
|
||||
configRUN_TIME_COUNTER_TYPE total_run_time;
|
||||
|
||||
if(task != NULL) {
|
||||
count = uxTaskGetSystemState(task, count, NULL);
|
||||
count = uxTaskGetSystemState(task, count, &total_run_time);
|
||||
|
||||
for(i = 0U; (i < count) && (i < array_items); i++) {
|
||||
for(i = 0U; (i < count) && (i < array_item_count); i++) {
|
||||
thread_array[i] = (FuriThreadId)task[i].xHandle;
|
||||
}
|
||||
count = i;
|
||||
|
||||
+8
-1
@@ -138,6 +138,13 @@ void furi_thread_set_context(FuriThread* thread, void* context);
|
||||
*/
|
||||
void furi_thread_set_priority(FuriThread* thread, FuriThreadPriority priority);
|
||||
|
||||
/** Get FuriThread priority
|
||||
*
|
||||
* @param thread FuriThread instance
|
||||
* @return FuriThreadPriority value
|
||||
*/
|
||||
FuriThreadPriority furi_thread_get_priority(FuriThread* thread);
|
||||
|
||||
/** Set current thread priority
|
||||
*
|
||||
* @param priority FuriThreadPriority value
|
||||
@@ -259,7 +266,7 @@ uint32_t furi_thread_flags_wait(uint32_t flags, uint32_t options, uint32_t timeo
|
||||
* @param array_items array size
|
||||
* @return uint32_t threads count
|
||||
*/
|
||||
uint32_t furi_thread_enumerate(FuriThreadId* thread_array, uint32_t array_items);
|
||||
uint32_t furi_thread_enumerate(FuriThreadId* thread_array, uint32_t array_item_count);
|
||||
|
||||
/**
|
||||
* @brief Get thread name
|
||||
|
||||
Reference in New Issue
Block a user