rtos.h
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright 2014-2019 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #ifndef RTOS_H_
14 #define RTOS_H_
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #include "../../src/ISConstants.h"
20 #include "task.h"
21 #include "../drivers/d_time.h"
22 #if !defined(PLATFORM_IS_EVB_2)
23 #include "../../../hdw-src/uINS-3/IS_uINS/src/misc/debug_gpio.h"
24 #endif
25 
26 #if defined(PLATFORM_IS_EVB_2) && PLATFORM_IS_EVB_2
27 #define RTOS_NUM_TASKS (EVB_RTOS_NUM_TASKS)
28 #else
29 #define RTOS_NUM_TASKS (UINS_RTOS_NUM_TASKS)
30 #endif
31 
32 #if defined(DBGPIO_START) && defined(DBGPIO_END)
33 #define BEGIN_CRITICAL_SECTION {vTaskSuspendAll(); taskENTER_CRITICAL(); DBGPIO_START(DBG_CRITICAL_SECTION_PIN);}
34 #define END_CRITICAL_SECTION {DBGPIO_END(DBG_CRITICAL_SECTION_PIN); taskEXIT_CRITICAL(); xTaskResumeAll();}
35 #else
36 #define BEGIN_CRITICAL_SECTION {vTaskSuspendAll(); taskENTER_CRITICAL();}
37 #define END_CRITICAL_SECTION {taskEXIT_CRITICAL(); xTaskResumeAll();}
38 #endif
39 
40 #define GPBR_IDX_STATUS 0
41 #define GPBR_IDX_G1_TASK 1
42 #define GPBR_IDX_G2_FILE_NUM 2
43 #define GPBR_IDX_G3_LINE_NUM 3
44 #define GPBR_IDX_G4_FLASH_MIG 4
45 #define GPBR_IDX_G5_LR 5
46 #define GPBR_IDX_PC 6
47 #define GPBR_IDX_PSR 7
48 
49 int createTask(
50  int index,
51  pdTASK_CODE pxTaskCode,
52  const char * const pcName,
53  unsigned short usStackDepth,
54  void *pvParameters,
55  unsigned portBASE_TYPE uxPriority,
56  portTickType xTimeIncrement);
57 
58 // Monitor state of RTOS (i.e. stack high water mark, unused words).
59 void rtos_monitor(int numRtosTasks);
60 void rtosResetStats(void);
61 
62 void vApplicationIdleHook(void);
63 void vApplicationTickHook(void);
64 void vApplicationStackOverflowHook(xTaskHandle *pxTask, signed char *pcTaskName);
65 void vApplicationMallocFailedHook(uint32_t size, uint32_t remaining, uint32_t prevLR);
66 
67 extern uint32_t g_faultLineNumber;
68 extern uint32_t g_faultFileNumber;
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 #endif // RTOS_H_
void vApplicationTickHook(void)
Definition: rtos.c:116
void rtosResetStats(void)
Definition: rtos.c:100
void vApplicationMallocFailedHook(uint32_t size, uint32_t remaining, uint32_t prevLR)
Definition: rtos.c:166
void vApplicationStackOverflowHook(xTaskHandle *pxTask, signed char *pcTaskName)
Definition: rtos.c:149
uint32_t g_faultFileNumber
Definition: rtos.c:26
void vApplicationIdleHook(void)
Definition: rtos.c:109
#define portTickType
Definition: FreeRTOS.h:900
#define xTaskHandle
Definition: FreeRTOS.h:901
uint32_t g_faultLineNumber
Definition: rtos.c:25
#define portBASE_TYPE
Definition: portmacro.h:54
#define pdTASK_CODE
Definition: FreeRTOS.h:922
void rtos_monitor(int numRtosTasks)
Definition: rtos.c:64
int createTask(int index, pdTASK_CODE pxTaskCode, const char *const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, portTickType xTimeIncrement)
Definition: rtos.c:30


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04