update credits
[librepilot.git] / flight / targets / boards / revonano / firmware / revolution.cpp
blob8c5bbf28c71a908dfd1ca114cfb8fde708a59940
1 /**
2 ******************************************************************************
3 * @addtogroup LibrePilotSystem LibrePilot System
4 * @brief These files are the core system files for Revolution.
5 * They are the ground layer just above PiOS. In practice, Revolution actually starts
6 * in the main() function of revolution.cpp
7 * @{
8 * @addtogroup LibrePilotCore LibrePilot Core
9 * @brief This is where the LP firmware starts. Those files also define the compile-time
10 * options of the firmware.
11 * @{
12 * @file revolution.cpp
13 * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
14 * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010-2015
15 * @brief Sets up and runs main tasks.
16 * @see The GNU Public License (GPL) Version 3
18 *****************************************************************************/
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 3 of the License, or
23 * (at your option) any later version.
25 * This program is distributed in the hope that it will be useful, but
26 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
27 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28 * for more details.
30 * You should have received a copy of the GNU General Public License along
31 * with this program; if not, write to the Free Software Foundation, Inc.,
32 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35 extern "C" {
36 #include "inc/openpilot.h"
37 #include <uavobjectsinit.h>
38 #include <systemmod.h>
41 /* Global Variables */
43 /* Local Variables */
46 /**
47 * OpenPilot Main function:
49 * Initialize PiOS<BR>
50 * Create the "System" task (SystemModInitializein Modules/System/systemmod.c) <BR>
51 * Start FreeRTOS Scheduler (vTaskStartScheduler)<BR>
52 * If something goes wrong, blink LED1 and LED2 every 100ms
55 int main()
57 /* NOTE: Do NOT modify the following start-up sequence */
58 /* Any new initialization functions should be added in OpenPilotInit() */
59 vPortInitialiseBlocks();
61 /* Brings up System using CMSIS functions, enables the LEDs. */
62 PIOS_SYS_Init();
64 SystemModStart();
66 /* Start the FreeRTOS scheduler */
67 vTaskStartScheduler();
69 /* If all is well we will never reach here as the scheduler will now be running. */
70 /* Do some PIOS_LED_HEARTBEAT to user that something bad just happened */
71 PIOS_LED_Off(PIOS_LED_HEARTBEAT); \
72 for (;;) { \
73 PIOS_LED_Toggle(PIOS_LED_HEARTBEAT); \
74 PIOS_DELAY_WaitmS(100); \
78 return 0;
82 /**
83 * @}
84 * @}