EVB-2/IS_EVB-2/src/main.cpp
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 #include "evb_tasks.h"
14 
15 
16 static void vTaskComm(void *pvParameters)
17 {
19  is_comm_instance_t &comm = evbTaskCommInit(pvParameters);
20 
21  while(1)
22  {
23  // EVB communications task
24  evbTaskComm(task, comm);
25 
27  // Suggested USER CODE Section
28  // Update period: 1ms (Adjust by changing TASK_COMM_PERIOD_MS)
29  // Priority: high
30  //
31  // Ensure code added here does not run longer than 1ms. Consider
32  // adding code to vTaskMaint if it runs longer than 1ms and does not
33  // require a high priority.
34 
35  // Add code here...
37  }
38 }
39 
40 
44 static void vTaskLogger(void *pvParameters)
45 {
47  is_comm_instance_t &comm = evbTaskLoggerInit(pvParameters);
48 
49  while(1)
50  {
51  // EVB logger task
52  evbTaskLogger(task, comm);
53  }
54 }
55 
56 
60 static void vTaskMaint(void *pvParameters)
61 {
63  evbTaskMaintInit(pvParameters);
64 
65  for (;;)
66  {
67  if(evbTaskMaint(task))
68  {
70 
72  // Slow Maintenance - 1000ms period - Suggested USER CODE Section
73  // Update period: 1000ms (Adjust by changing TASK_MAINT_SUB_TASK_PERIOD_MS)
74  // Priority: low
75  //
76  // Consider adding code to vTaskComm if it needs to run faster than every
77  // 10ms or requires a higher priority.
78 
79  // Add code here...
81 
82  //Test code for ADC
83  g_debug.f[0] = adc_voltage();
84  }
85 
87  // Fast Maintenance - 10ms period - Suggested USER CODE Section
88  // Update period: 10ms (Adjust by changing TASK_MAINT_PERIOD_MS)
89  // Priority: low
90  //
91  // Consider adding code to vTaskComm if it needs to run faster than every
92  // 10ms or requires a higher priority.
93 
94  // Add code here...
96  }
97 }
98 
99 
100 int main(void)
101 {
102  evbMainInit();
103  evbMainInitHdw();
105 
106  int result = evbMain();
107 
108  // Will only get here if there was insufficient memory to create the idle task.
109  return result;
110 }
float adc_voltage(void)
Definition: d_adc.c:33
is_comm_instance_t & evbTaskLoggerInit(void *pvParameters)
Definition: evb_tasks.cpp:66
f_t f[DEBUG_F_ARRAY_SIZE]
Definition: data_sets.h:2106
void evbMainInitHdw(void)
Definition: evb_tasks.cpp:182
static void vTaskLogger(void *pvParameters)
RTOS logger task.
void evbTaskComm(rtos_task_t &task, is_comm_instance_t &comm)
Definition: evb_tasks.cpp:42
evb_rtos_info_t g_rtos
Definition: globals.c:27
is_comm_instance_t & evbTaskCommInit(void *pvParameters)
Definition: evb_tasks.cpp:17
int evbTaskMaint(rtos_task_t &task)
Definition: evb_tasks.cpp:110
debug_array_t g_debug
Definition: globals.c:26
rtos_task_t task[UINS_RTOS_NUM_TASKS]
Definition: data_sets.h:3457
void evbTaskMaintInit(void *pvParameters)
Definition: evb_tasks.cpp:104
void nvr_slow_maintenance(void)
Definition: globals.c:322
void evbTaskLogger(rtos_task_t &task, is_comm_instance_t &comm)
Definition: evb_tasks.cpp:86
int main(void)
static void vTaskMaint(void *pvParameters)
RTOS maintenance task.
void vTaskWiFi(void *pvParameters)
Definition: wifi.c:395
void evbMainInitRTOS(pdTASK_CODE pxTaskComm, pdTASK_CODE pxTaskLogg, pdTASK_CODE pxTaskWifi, pdTASK_CODE pxTaskMant)
Definition: evb_tasks.cpp:196
int evbMain(void)
Definition: evb_tasks.cpp:220
static void vTaskComm(void *pvParameters)
void evbMainInit(void)
Definition: evb_tasks.cpp:151


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:58