1 /* Copyright (C) 2013, 2015 Czech Technical University in Prague
4 * - Carlos Jenkins <carlos@jenkins.co.cr>
6 * This document contains proprietary information belonging to Czech
7 * Technical University in Prague. Passing on and copying of this
8 * document, and communication of its contents is not permitted
9 * without prior written authorization.
13 * Example/Base main file for RPP API library.
16 * RPP API documentation.
25 static const portTickType freq_ticks = 1000 / portTICK_RATE_MS;
26 portTickType last_wake_time = xTaskGetTickCount();
30 /* Wait until next step */
31 vTaskDelayUntil(&last_wake_time, freq_ticks);
32 rpp_sci_printf((const char *)"Hello RPP.\r\n");
40 /* Initialize RPP board */
44 if (xTaskCreate(my_task, FREERTOS_TASK_NAME("my_task"),
45 512, NULL, 0, NULL) != pdPASS) {
47 rpp_sci_printf((const char *)
48 "ERROR: Cannot spawn control task.\r\n"
55 /* Start the FreeRTOS Scheduler */
56 vTaskStartScheduler();
58 /* Catch scheduler start error */
60 rpp_sci_printf((const char *)
61 "ERROR: Problem allocating memory for idle task.\r\n"
69 #if configUSE_MALLOC_FAILED_HOOK == 1
71 * FreeRTOS malloc() failed hook.
73 void vApplicationMallocFailedHook(void)
76 rpp_sci_printf((const char *)
77 "ERROR: manual memory allocation failed.\r\n"
84 #if configCHECK_FOR_STACK_OVERFLOW > 0
86 * FreeRTOS stack overflow hook.
88 void vApplicationStackOverflowHook(xTaskHandle xTask,
89 signed portCHAR *pcTaskName)
92 rpp_sci_printf((const char *)
93 "ERROR: Stack overflow : \"%s\".\r\n", pcTaskName