[FL-2844] desktop: removing slideshow file when leaving slideshow view (#1762)

* [FL-2844] desktop: removing slideshow file when leaving slideshow view; vscode: fix for BM port fetcher; fap api: more symbols for LL
* desktop: actually removing slideshow file
* desktop: moved slideshow removal to scene code; fbt: better blackmagic device handling
* fbt: disabled pagination for gdb
* vscode: restored blackmagic command line
* fbt: fixed debug_other target; added debug_other_blackmagic
* furi: added furi_thread_suspend API group; fixed null-pointer deref for thread name; cleaned up RTOS config
* furi: changed thread state check to eTaskGetState
This commit is contained in:
hedger
2022-09-21 18:42:59 +04:00
committed by GitHub
parent 3360f818a1
commit 432ff41d6a
8 changed files with 84 additions and 37 deletions

View File

@@ -89,7 +89,9 @@ static void furi_thread_body(void* context) {
if(thread->is_service) {
FURI_LOG_E(
"Service", "%s thread exited. Thread memory cannot be reclaimed.", thread->name);
"Service",
"%s thread exited. Thread memory cannot be reclaimed.",
thread->name ? thread->name : "<unknown service>");
}
// clear thread local storage
@@ -515,4 +517,23 @@ size_t furi_thread_stdout_write(const char* data, size_t size) {
int32_t furi_thread_stdout_flush() {
return __furi_thread_stdout_flush(furi_thread_get_current());
}
}
void furi_thread_suspend(FuriThreadId thread_id) {
TaskHandle_t hTask = (TaskHandle_t)thread_id;
vTaskSuspend(hTask);
}
void furi_thread_resume(FuriThreadId thread_id) {
TaskHandle_t hTask = (TaskHandle_t)thread_id;
if(FURI_IS_IRQ_MODE()) {
xTaskResumeFromISR(hTask);
} else {
vTaskResume(hTask);
}
}
bool furi_thread_is_suspended(FuriThreadId thread_id) {
TaskHandle_t hTask = (TaskHandle_t)thread_id;
return eTaskGetState(hTask) == eSuspended;
}

View File

@@ -236,6 +236,25 @@ size_t furi_thread_stdout_write(const char* data, size_t size);
*/
int32_t furi_thread_stdout_flush();
/** Suspend thread
*
* @param thread_id thread id
*/
void furi_thread_suspend(FuriThreadId thread_id);
/** Resume thread
*
* @param thread_id thread id
*/
void furi_thread_resume(FuriThreadId thread_id);
/** Get thread suspended state
*
* @param thread_id thread id
* @return true if thread is suspended
*/
bool furi_thread_is_suspended(FuriThreadId thread_id);
#ifdef __cplusplus
}
#endif