use crate::types::*;
pub const configUSE_PREEMPTION: BaseType_t = 1;
pub const configMAX_PRIORITIES: UBaseType_t = 5;
pub const configMINIMAL_STACK_SIZE: usize = 128;
pub const configTICK_RATE_HZ: TickType_t = 1000;
#[cfg(not(feature = "user-config"))]
pub const configCPU_CLOCK_HZ: u32 = 80_000_000;
#[cfg(feature = "user-config")]
extern "Rust" {
#[link_name = "FREERTOS_CONFIG_CPU_CLOCK_HZ"]
pub static configCPU_CLOCK_HZ: u32;
}
#[cfg(all(feature = "port-riscv32", not(feature = "user-config")))]
pub const configMTIME_HZ: u32 = 32_768;
#[cfg(all(feature = "port-riscv32", feature = "user-config"))]
extern "Rust" {
#[link_name = "FREERTOS_CONFIG_MTIME_HZ"]
pub static configMTIME_HZ: u32;
}
pub const configMAX_SYSCALL_INTERRUPT_PRIORITY: u32 = 191;
pub const configMAX_TASK_NAME_LEN: usize = 16;
pub const configNUMBER_OF_CORES: BaseType_t = 1;
pub const configUSE_IDLE_HOOK: BaseType_t = 0;
pub const configUSE_TICK_HOOK: BaseType_t = 0;
pub const configUSE_MALLOC_FAILED_HOOK: BaseType_t = 0;
pub const configSUPPORT_STATIC_ALLOCATION: BaseType_t = 1;
#[cfg(any(feature = "alloc", feature = "heap-4", feature = "heap-5"))]
pub const configSUPPORT_DYNAMIC_ALLOCATION: BaseType_t = 1;
#[cfg(not(any(feature = "alloc", feature = "heap-4", feature = "heap-5")))]
pub const configSUPPORT_DYNAMIC_ALLOCATION: BaseType_t = 0;
pub const configTOTAL_HEAP_SIZE: usize = 6144;
#[cfg(feature = "use-mutexes")]
pub const configUSE_MUTEXES: BaseType_t = 1;
#[cfg(not(feature = "use-mutexes"))]
pub const configUSE_MUTEXES: BaseType_t = 0;
#[cfg(feature = "use-mutexes")]
pub const configUSE_RECURSIVE_MUTEXES: BaseType_t = 1;
#[cfg(not(feature = "use-mutexes"))]
pub const configUSE_RECURSIVE_MUTEXES: BaseType_t = 0;
pub const configUSE_COUNTING_SEMAPHORES: BaseType_t = 1;
#[cfg(feature = "queue-sets")]
pub const configUSE_QUEUE_SETS: BaseType_t = 1;
#[cfg(not(feature = "queue-sets"))]
pub const configUSE_QUEUE_SETS: BaseType_t = 0;
#[cfg(feature = "queue-registry")]
pub const configQUEUE_REGISTRY_SIZE: usize = 8;
pub const configUSE_TASK_NOTIFICATIONS: BaseType_t = 1;
pub const configTASK_NOTIFICATION_ARRAY_ENTRIES: usize = 1;
#[cfg(feature = "timers")]
pub const configUSE_TIMERS: BaseType_t = 1;
#[cfg(not(feature = "timers"))]
pub const configUSE_TIMERS: BaseType_t = 0;
pub const configTIMER_TASK_PRIORITY: UBaseType_t = 2;
pub const configTIMER_QUEUE_LENGTH: UBaseType_t = 10;
pub const configTIMER_TASK_STACK_DEPTH: usize = configMINIMAL_STACK_SIZE;
pub const configUSE_MINI_LIST_ITEM: BaseType_t = 0;
#[cfg(feature = "list-data-integrity-check")]
pub const configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES: BaseType_t = 1;
#[cfg(not(feature = "list-data-integrity-check"))]
pub const configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES: BaseType_t = 0;
pub const configASSERT_DEFINED: BaseType_t = 1;
#[inline(always)]
#[track_caller]
pub fn configASSERT(condition: bool) {
if configASSERT_DEFINED != 0 {
assert!(condition, "FreeRTOS assertion failed");
}
}
#[cfg(test)]
mod config_assert_tests {
use super::*;
#[test]
fn config_assert_accepts_true() {
configASSERT(true);
}
#[test]
#[should_panic(expected = "FreeRTOS assertion failed")]
fn config_assert_rejects_false_in_release_too() {
configASSERT(false);
}
#[test]
fn cargo_capabilities_match_exported_configuration_constants() {
assert_eq!(configUSE_MUTEXES != 0, cfg!(feature = "use-mutexes"));
assert_eq!(configUSE_QUEUE_SETS != 0, cfg!(feature = "queue-sets"));
assert_eq!(
INCLUDE_vTaskPrioritySet != 0,
cfg!(feature = "task-priority-set")
);
assert_eq!(
INCLUDE_uxTaskPriorityGet != 0,
cfg!(feature = "task-priority-set")
);
assert_eq!(INCLUDE_vTaskDelete != 0, cfg!(feature = "task-delete"));
assert_eq!(INCLUDE_vTaskSuspend != 0, cfg!(feature = "task-suspend"));
assert_eq!(
INCLUDE_xTaskResumeFromISR != 0,
cfg!(feature = "task-suspend")
);
assert_eq!(
INCLUDE_xQueueGetMutexHolder != 0,
cfg!(feature = "use-mutexes")
);
assert_eq!(
configGENERATE_RUN_TIME_STATS != 0,
cfg!(feature = "generate-run-time-stats")
);
assert_eq!(
configCHECK_FOR_STACK_OVERFLOW != 0,
cfg!(feature = "stack-overflow-check")
);
assert_eq!(configUSE_POSIX_ERRNO, 0);
assert_eq!(portCRITICAL_NESTING_IN_TCB, 0);
}
}
#[cfg(feature = "task-priority-set")]
pub const INCLUDE_vTaskPrioritySet: BaseType_t = 1;
#[cfg(not(feature = "task-priority-set"))]
pub const INCLUDE_vTaskPrioritySet: BaseType_t = 0;
#[cfg(feature = "task-priority-set")]
pub const INCLUDE_uxTaskPriorityGet: BaseType_t = 1;
#[cfg(not(feature = "task-priority-set"))]
pub const INCLUDE_uxTaskPriorityGet: BaseType_t = 0;
#[cfg(feature = "task-delete")]
pub const INCLUDE_vTaskDelete: BaseType_t = 1;
#[cfg(not(feature = "task-delete"))]
pub const INCLUDE_vTaskDelete: BaseType_t = 0;
#[cfg(feature = "task-suspend")]
pub const INCLUDE_vTaskSuspend: BaseType_t = 1;
#[cfg(not(feature = "task-suspend"))]
pub const INCLUDE_vTaskSuspend: BaseType_t = 0;
pub const INCLUDE_xTaskDelayUntil: BaseType_t = 1;
pub const INCLUDE_vTaskDelay: BaseType_t = 1;
pub const INCLUDE_xTaskGetIdleTaskHandle: BaseType_t = 0;
#[cfg(feature = "abort-delay")]
pub const INCLUDE_xTaskAbortDelay: BaseType_t = 1;
#[cfg(not(feature = "abort-delay"))]
pub const INCLUDE_xTaskAbortDelay: BaseType_t = 0;
#[cfg(feature = "use-mutexes")]
pub const INCLUDE_xQueueGetMutexHolder: BaseType_t = 1;
#[cfg(not(feature = "use-mutexes"))]
pub const INCLUDE_xQueueGetMutexHolder: BaseType_t = 0;
pub const INCLUDE_xTaskGetHandle: BaseType_t = 0;
#[cfg(feature = "stack-high-water-mark")]
pub const INCLUDE_uxTaskGetStackHighWaterMark: BaseType_t = 1;
#[cfg(not(feature = "stack-high-water-mark"))]
pub const INCLUDE_uxTaskGetStackHighWaterMark: BaseType_t = 0;
#[cfg(feature = "stack-high-water-mark")]
pub const INCLUDE_uxTaskGetStackHighWaterMark2: BaseType_t = 1;
#[cfg(not(feature = "stack-high-water-mark"))]
pub const INCLUDE_uxTaskGetStackHighWaterMark2: BaseType_t = 0;
pub const INCLUDE_eTaskGetState: BaseType_t = 1;
#[cfg(feature = "task-suspend")]
pub const INCLUDE_xTaskResumeFromISR: BaseType_t = 1;
#[cfg(not(feature = "task-suspend"))]
pub const INCLUDE_xTaskResumeFromISR: BaseType_t = 0;
#[cfg(feature = "pend-function-call")]
pub const INCLUDE_xTimerPendFunctionCall: BaseType_t = 1;
#[cfg(not(feature = "pend-function-call"))]
pub const INCLUDE_xTimerPendFunctionCall: BaseType_t = 0;
pub const INCLUDE_xTaskGetSchedulerState: BaseType_t = 1;
pub const INCLUDE_xTaskGetCurrentTaskHandle: BaseType_t = 1;
#[cfg(feature = "trace-facility")]
pub const configUSE_TRACE_FACILITY: BaseType_t = 1;
#[cfg(not(feature = "trace-facility"))]
pub const configUSE_TRACE_FACILITY: BaseType_t = 0;
#[cfg(feature = "generate-run-time-stats")]
pub const configGENERATE_RUN_TIME_STATS: BaseType_t = 1;
#[cfg(not(feature = "generate-run-time-stats"))]
pub const configGENERATE_RUN_TIME_STATS: BaseType_t = 0;
#[cfg(feature = "application-task-tag")]
pub const configUSE_APPLICATION_TASK_TAG: BaseType_t = 1;
#[cfg(not(feature = "application-task-tag"))]
pub const configUSE_APPLICATION_TASK_TAG: BaseType_t = 0;
#[cfg(feature = "thread-local-storage")]
pub const configNUM_THREAD_LOCAL_STORAGE_POINTERS: usize = 5;
#[cfg(not(feature = "thread-local-storage"))]
pub const configNUM_THREAD_LOCAL_STORAGE_POINTERS: usize = 0;
pub const configUSE_POSIX_ERRNO: BaseType_t = 0;
pub const configUSE_PORT_OPTIMISED_TASK_SELECTION: BaseType_t = 0;
pub const configUSE_CORE_AFFINITY: BaseType_t = 0;
pub const configUSE_TASK_PREEMPTION_DISABLE: BaseType_t = 0;
#[cfg(feature = "tickless-idle")]
pub const configUSE_TICKLESS_IDLE: BaseType_t = 1;
#[cfg(not(feature = "tickless-idle"))]
pub const configUSE_TICKLESS_IDLE: BaseType_t = 0;
pub const configEXPECTED_IDLE_TIME_BEFORE_SLEEP: super::types::TickType_t = 2;
pub const configINITIAL_TICK_COUNT: super::types::TickType_t = 0;
pub const tskIDLE_PRIORITY: super::types::UBaseType_t = 0;
#[cfg(feature = "stack-overflow-check")]
pub const configCHECK_FOR_STACK_OVERFLOW: BaseType_t = 2;
#[cfg(not(feature = "stack-overflow-check"))]
pub const configCHECK_FOR_STACK_OVERFLOW: BaseType_t = 0;
#[cfg(feature = "record-stack-high-address")]
pub const configRECORD_STACK_HIGH_ADDRESS: BaseType_t = 1;
#[cfg(not(feature = "record-stack-high-address"))]
pub const configRECORD_STACK_HIGH_ADDRESS: BaseType_t = 0;
pub const configKERNEL_PROVIDED_STATIC_MEMORY: BaseType_t = 0;
pub const portCRITICAL_NESTING_IN_TCB: BaseType_t = 0;
pub const portUSING_MPU_WRAPPERS: BaseType_t = 0;
pub type configSTACK_DEPTH_TYPE = usize;
pub type configRUN_TIME_COUNTER_TYPE = u32;
pub const tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE: BaseType_t =
if configSUPPORT_STATIC_ALLOCATION != 0 && configSUPPORT_DYNAMIC_ALLOCATION != 0 {
1
} else {
0
};
pub const tskSET_NEW_STACKS_TO_KNOWN_VALUE: BaseType_t = if configCHECK_FOR_STACK_OVERFLOW > 1
|| configUSE_TRACE_FACILITY != 0
|| INCLUDE_uxTaskGetStackHighWaterMark != 0
|| INCLUDE_uxTaskGetStackHighWaterMark2 != 0
{
1
} else {
0
};
pub const tskSTACK_FILL_BYTE: u8 = 0xA5;