1 // Copyright 2022 The Pigweed Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 // use this file except in compliance with the License. You may obtain a copy of 5 // the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 // License for the specific language governing permissions and limitations under 13 // the License. 14 #pragma once 15 16 #include <stdint.h> 17 18 // Externally defined variables that must be forward-declared for FreeRTOS to 19 // use them. 20 extern uint32_t SystemCoreClock; 21 extern void configureTimerForRunTimeStats(void); 22 extern unsigned long getRunTimeCounterValue(void); 23 24 #define configSUPPORT_DYNAMIC_ALLOCATION 0 25 #define configSUPPORT_STATIC_ALLOCATION 1 26 27 #define configUSE_16_BIT_TICKS 0 28 #define configUSE_CO_ROUTINES 0 29 #define configUSE_IDLE_HOOK 0 30 #define configUSE_MUTEXES 1 31 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 32 #define configUSE_PREEMPTION 1 33 #define configUSE_TICK_HOOK 0 34 #define configUSE_TIMERS 1 35 #define configUSE_TRACE_FACILITY 1 36 37 #define configGENERATE_RUN_TIME_STATS 1 38 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS configureTimerForRunTimeStats 39 #define portGET_RUN_TIME_COUNTER_VALUE getRunTimeCounterValue 40 41 #define configCHECK_FOR_STACK_OVERFLOW 2 42 #define configCPU_CLOCK_HZ (SystemCoreClock) 43 #define configENABLE_BACKWARD_COMPATIBILITY 0 44 #define configMAX_CO_ROUTINE_PRIORITIES (2) 45 #define configMAX_PRIORITIES (7) 46 #define configMAX_TASK_NAME_LEN (16) 47 #define configMESSAGE_BUFFER_LENGTH_TYPE size_t 48 #define configMINIMAL_STACK_SIZE ((uint16_t)128) 49 #define configQUEUE_REGISTRY_SIZE 8 50 #define configRECORD_STACK_HIGH_ADDRESS 1 51 #define configTICK_RATE_HZ ((TickType_t)1000) 52 #define configTIMER_QUEUE_LENGTH 10 53 #define configTIMER_TASK_PRIORITY (6) 54 #define configTIMER_TASK_STACK_DEPTH 512 55 56 /* __NVIC_PRIO_BITS in CMSIS */ 57 #define configPRIO_BITS 4 58 59 #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 60 #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 61 #define configKERNEL_INTERRUPT_PRIORITY \ 62 (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) 63 #define configMAX_SYSCALL_INTERRUPT_PRIORITY \ 64 (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) 65 66 #define INCLUDE_uxTaskPriorityGet 1 67 #define INCLUDE_vTaskCleanUpResources 0 68 #define INCLUDE_vTaskDelay 1 69 #define INCLUDE_vTaskDelayUntil 0 70 #define INCLUDE_vTaskDelete 1 71 #define INCLUDE_vTaskPrioritySet 1 72 #define INCLUDE_vTaskSuspend 1 73 #define INCLUDE_xTaskGetSchedulerState 1 74 75 // Instead of defining configASSERT(), include a header that provides a 76 // definition that redirects to pw_assert. 77 #include "pw_third_party/freertos/config_assert.h" 78 79 #define vPortSVCHandler SVC_Handler 80 #define xPortPendSVHandler PendSV_Handler 81 #define xPortSysTickHandler SysTick_Handler 82