-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.c
72 lines (50 loc) · 1.26 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* (C) András Wiesner, 2020 */
// FreeRTOS includes
#include "FreeRTOS.h"
#include "task.h"
// oscillator init function
#include "osc.h"
#include "utils.h"
// UART communication
#include "uart_comm.h"
#include "drivers/pinout.h"
// task management
#include "tasks/user_tasks.h"
// global initialization
void init() {
OSC_init(); // initializing oscillator
UART_init(); // UART initialization (115200bps)
}
// task registration
void reg_tasks() {
reg_task_eth(); // registering eth task
reg_task_cli(); // registering cli task
}
int main(void)
{
init(); // initialization
// configuring Ethernet pins
PinoutSet(true, false);
// --------
MSG("\033[2J\033[H");
MSG("Registering tasks...\r\n");
reg_tasks(); // registering tasks
// ---------
// starting scheduler
MSG("Starting scheduler...\r\n");
vTaskStartScheduler();
}
//*****************************************************************************
void
vApplicationStackOverflowHook(xTaskHandle *pxTask, char *pcTaskName)
{
UARTprintf("Stack overflow in task: %s\r\n", pcTaskName);
while(1)
{
}
}
// runtime statistics...
volatile unsigned long g_vulRunTimeStatsCountValue;
void __error__(char *pcFilename, uint32_t ui32Line) {
UARTprintf("%s:%d\r\n", pcFilename, ui32Line);
}