Robobo
FreeRTOSVariant.h
1 /*
2  * Copyright (C) 2017 Phillip Stevens All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy of
5  * this software and associated documentation files (the "Software"), to deal in
6  * the Software without restriction, including without limitation the rights to
7  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8  * the Software, and to permit persons to whom the Software is furnished to do so,
9  * subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in all
12  * copies or substantial portions of the Software. If you wish to use our Amazon
13  * FreeRTOS name, please do so in a fair use way that does not cause confusion.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * 1 tab == 4 spaces!
23  *
24  * This file is NOT part of the FreeRTOS distribution.
25  *
26  */
27 
28 #ifndef freeRTOSVariant_h
29 #define freeRTOSVariant_h
30 
31 #include "task.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 // System Tick - Scheduler timer
38 // Use the Watchdog timer, and choose the rate at which scheduler interrupts will occur.
39 
40 #define portUSE_WDTO WDTO_15MS // portUSE_WDTO to use the Watchdog Timer for xTaskIncrementTick
41 
42 /* Watchdog period options: WDTO_15MS
43  WDTO_30MS
44  WDTO_60MS
45  WDTO_120MS
46  WDTO_250MS
47  WDTO_500MS
48 */
49 // xxx Watchdog Timer is 128kHz nominal, but 120 kHz at 5V DC and 25 degrees is actually more accurate, from data sheet.
50 #define configTICK_RATE_HZ ( (TickType_t)( (uint32_t)128000 >> (portUSE_WDTO + 11) ) ) // 2^11 = 2048 WDT scaler for 128kHz Timer
51 
52 /*-----------------------------------------------------------*/
53 
54 void initVariant(void);
55 
56 void vApplicationIdleHook( void );
57 
58 void vApplicationMallocFailedHook( void );
59 void vApplicationStackOverflowHook( TaskHandle_t xTask, portCHAR *pcTaskName );
60 
61 void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer,
62  StackType_t **ppxIdleTaskStackBuffer,
63  uint32_t *pulIdleTaskStackSize );
64 void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer,
65  StackType_t **ppxTimerTaskStackBuffer,
66  uint32_t *pulTimerTaskStackSize );
67 
68 /*-----------------------------------------------------------*/
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif // freeRTOSVariant_h