]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blob - rpp-test-sw/commands/_rm48_hdk/main.c
Update Makefile so that Eclipse does not blow up the buildbot server
[pes-rpp/rpp-test-sw.git] / rpp-test-sw / commands / _rm48_hdk / main.c
1 /*\r
2  * Copyright (C) 2012-2014 Czech Technical University in Prague\r
3  *\r
4  * Created on: 15.3.2012\r
5  *\r
6  * Authors:\r
7  *     - Michal Horn\r
8  *     - Carlos Jenkins <carlos@jenkins.co.cr>\r
9  *\r
10  * This document contains proprietary information belonging to Czech\r
11  * Technical University in Prague. Passing on and copying of this\r
12  * document, and communication of its contents is not permitted\r
13  * without prior written authorization.\r
14  *\r
15  * File : main.c\r
16  *\r
17  * Abstract:\r
18  *      This file contains main function and Hook functions used by IDLE task.\r
19  *\r
20  */\r
21 \r
22 /* Include Files */\r
23 #include "rpp/rpp.h"\r
24 #include "os/os.h"\r
25 #include "cmdproc_freertos.h"\r
26 #include "version.h" // Generated by Eclipse in the pre-build step\r
27 \r
28 /** @fn void main(void)\r
29  *   @brief Application main function\r
30  *\r
31  *   This function is called after startup.\r
32  */\r
33 void main(void)\r
34 {\r
35         rpp_adc_init();\r
36         rpp_gio_init(RPP_GIO_PORT_ALL);\r
37         rpp_sci_init();\r
38 \r
39         // Speed up the SCI\r
40         rpp_sci_setup(115200);\r
41 \r
42         rpp_sci_printf("\nTi HDK RM48L952, FreeRTOS %d.%d.%d\n", FREERTOS_VERSION_NUMBER_MAYOR, FREERTOS_VERSION_NUMBER_MINOR, FREERTOS_VERSION_NUMBER_REV);\r
43         rpp_sci_printf("Test Software version " GIT_VERSION "\n");\r
44         rpp_sci_printf("CTU in Prague 10/2014\n");\r
45 \r
46         initCmdProc(0);\r
47         vTaskStartScheduler();\r
48 \r
49         //We should never get here\r
50         while (1)\r
51                 ;\r
52 }\r
53 \r
54 #if configUSE_MALLOC_FAILED_HOOK == 1\r
55 /**\r
56  * FreeRTOS malloc() failed hook.\r
57  */\r
58 void vApplicationMallocFailedHook(void)\r
59 {\r
60         #ifdef DEBUG\r
61         rpp_sci_printf("ERROR: manual memory allocation failed.\r\n");\r
62         #endif\r
63 }\r
64 #endif\r
65 \r
66 \r
67 #if configCHECK_FOR_STACK_OVERFLOW > 0\r
68 /**\r
69  * FreeRTOS stack overflow hook.\r
70  */\r
71 void vApplicationStackOverflowHook(xTaskHandle xTask,\r
72                                                                    signed portCHAR *pcTaskName)\r
73 {\r
74         #ifdef DEBUG\r
75         rpp_sci_printf("ERROR: Stack overflow : \"%s\".\r\n", pcTaskName);\r
76         #endif\r
77 }\r
78 #endif\r