Skip to content

Commit

Permalink
Fixed shim complilation issues (#65)
Browse files Browse the repository at this point in the history
* Make freertos_rs_get_system_state() optional with #if guard. uxTaskGetSystemState() is only available when configUSE_TRACE_FACILITY is enabled

* Suppress unused parameter warning when INCLUDE_uxTaskGetStackHighWaterMark is disabled
  • Loading branch information
IsaacDynamo committed Mar 20, 2024
1 parent 77bdd5e commit e8b36d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions freertos-rust/src/freertos/shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ TickType_t freertos_rs_xTaskGetTickCount() {
return xTaskGetTickCount();
}

#if (configUSE_TRACE_FACILITY == 1)
UBaseType_t freertos_rs_get_system_state(TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime) {
return uxTaskGetSystemState(pxTaskStatusArray, uxArraySize, pulTotalRunTime);
}
#endif

#ifdef configCPU_CLOCK_HZ
unsigned long freertos_rs_get_configCPU_CLOCK_HZ() {
Expand Down Expand Up @@ -232,6 +234,7 @@ UBaseType_t freertos_rs_get_stack_high_water_mark(TaskHandle_t task) {
#if (INCLUDE_uxTaskGetStackHighWaterMark == 1)
return uxTaskGetStackHighWaterMark(task);
#else
(void)task;
return 0;
#endif
}
Expand Down

0 comments on commit e8b36d4

Please sign in to comment.