-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.c
71 lines (56 loc) · 1.38 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
/**
* @file main.c
*
* @brief UART driver demonstration - a simple UPCASE echo service
*
* This demo contains 1 task that listens for incoming characters and
* echoes all characters back in upper case. Each processed character
* is also indicated by toggling the LED.
*/
/* Standard includes. */
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
/* FreeRTOS includes */
#include <FreeRTOS.h>
#include <task.h>
/* FreeRTOS drivers */
#include <freertos-drivers/uart/uart.h>
#include <freertos-drivers/gpio/gpio_port.h>
/* lib-rtos includes */
#include <lib-rtos/time.h>
#include <lib-rtos/assert.h>
#include <lib-rtos/task.h>
/* board support package */
#include <bsp.h>
struct task micropython_task;
extern void micropython_task_method(void *args);
/**
* Hardware initialization
*/
static inline void hw_init()
{
bsp_init();
}
/*
* Create the demo tasks then start the scheduler.
*/
int main(void)
{
int result;
hw_init();
result = task__init(µpython_task,
(task__entry_method_t)micropython_task_method,
NULL, "uPy-Task",
CONFIG_APP_MICROPYTHON_TASK_STACK_SIZE,
CONFIG_APP_MICROPYTHON_TASK_PRIORITY);
assert(result == E_OK);
/* Finally start the scheduler. */
vTaskStartScheduler();
/* Will only reach here if there is insufficient heap available to start
* the scheduler. */
return 0;
}
void vApplicationIdleHook(void)
{
}