2 * Copyright (C) 2012-2015 Czech Technical University in Prague
\r
4 * Created on: 15.3.2012
\r
8 * - Carlos Jenkins <carlos@jenkins.co.cr>
\r
10 * Permission is hereby granted, free of charge, to any person
\r
11 * obtaining a copy of this software and associated documentation
\r
12 * files (the "Software"), to deal in the Software without
\r
13 * restriction, including without limitation the rights to use,
\r
14 * copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
15 * copies of the Software, and to permit persons to whom the
\r
16 * Software is furnished to do so, subject to the following
\r
19 * The above copyright notice and this permission notice shall be
\r
20 * included in all copies or substantial portions of the Software.
\r
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
\r
24 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
25 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
\r
26 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
\r
27 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
\r
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
\r
29 * OTHER DEALINGS IN THE SOFTWARE.
\r
34 * This file contains main function and Hook functions used by IDLE task.
\r
39 #include "rpp/rpp.h"
\r
41 #include "cmdproc_freertos.h"
\r
42 #include "version.h" // Generated by Makefile
\r
44 #if defined(TARGET_TMS570_HDK)
\r
45 #define TARGET_STR "TI HDK TMS570LS3137"
\r
46 #elif defined(TARGET_RM48_HDK)
\r
47 #define TARGET_STR "TI HDK RM48L952"
\r
48 #elif defined(TARGET_TMS570_HYDCTR)
\r
49 #define TARGET_STR "Eaton Hydraulics Controller"
\r
50 #elif defined(TARGET_TMS570_RPP)
\r
51 #define TARGET_STR "Porsche Rapid Prototyping Platform"
\r
52 #elif defined(TARGET_POSIX)
\r
53 #define TARGET_STR "POSIX version"
\r
55 #error Unknown target
\r
58 /** @fn void main(void)
\r
59 * @brief Application main function
\r
61 * This function is called after startup.
\r
68 rpp_sci_setup(115200);
\r
70 rpp_sci_printf("\n" TARGET_STR ", FreeRTOS %d.%d.%d\n", FREERTOS_VERSION_NUMBER_MAYOR, FREERTOS_VERSION_NUMBER_MINOR, FREERTOS_VERSION_NUMBER_REV);
\r
71 rpp_sci_printf("Test Software version " GIT_VERSION "\n");
\r
72 rpp_sci_printf("CTU in Prague 04/2015\n");
\r
75 vTaskStartScheduler();
\r
77 //We should never get here
\r
82 #if configUSE_MALLOC_FAILED_HOOK == 1
\r
84 * FreeRTOS malloc() failed hook.
\r
86 void vApplicationMallocFailedHook(void)
\r
89 rpp_sci_printf("ERROR: manual memory allocation failed.\r\n");
\r
95 #if configCHECK_FOR_STACK_OVERFLOW > 0
\r
97 * FreeRTOS stack overflow hook.
\r
99 void vApplicationStackOverflowHook(xTaskHandle xTask,
\r
100 signed portCHAR *pcTaskName)
\r
103 rpp_sci_printf("ERROR: Stack overflow : \"%s\".\r\n", pcTaskName);
\r