Skip to content

Commit

Permalink
Task Monitor Hotfix (#1444)
Browse files Browse the repository at this point in the history
### Changelist 
<!-- Give a list of the changes covered in this PR. This will help both
you and the reviewer keep this PR within scope. -->

### Testing Done
<!-- Outline the testing that was done to demonstrate the changes are
solid. This could be unit tests, integration tests, testing on the car,
etc. Include relevant code snippets, screenshots, etc as needed. -->

### Resolved Tickets
<!-- Link any tickets that this PR resolves. -->
  • Loading branch information
Lucien950 authored Feb 4, 2025
1 parent 3d4cd44 commit 75bef45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion firmware/shared/src/io/io_taskMonitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ float io_taskMonitor_getStackUsage(const TaskMonitor *monitor)
{
// WARNING: osThreadGetStackSize is not implemented in FreeRTOS
// https://github.com/ARM-software/CMSIS-FreeRTOS/blob/dd7793adcbea0c3c0f3524f86b031ab88b9e2193/DoxyGen/General/src/cmsis_freertos.txt#L312
const float free_space = (float)osThreadGetStackSpace(monitor->handle) / (float)monitor->attributes->stack_size;
const float free_space = (float)osThreadGetStackSpace(*monitor->handle) / (float)monitor->attributes->stack_size;
return 1 - free_space;
}
2 changes: 1 addition & 1 deletion firmware/shared/src/io/io_taskMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ EMPTY_STRUCT(TaskMonitor);
* @brief Check the stack high watermark for FreeRTOS tasks.
* Typically, you would call this function at 1Hz to minimize overhead.
*/
float io_taskMonitor_getStackUsage(const TaskMonitor *stack);
float io_taskMonitor_getStackUsage(const TaskMonitor *monitor);

0 comments on commit 75bef45

Please sign in to comment.