1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-10 18:24:11 +01:00
LibrePilot/flight/PipBee/pipbee.c
pip 611aee73ad Removed I2C support from PipBee as it's not used. Added 4 LED definitions.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1208 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-04 17:35:48 +00:00

92 lines
2.1 KiB
C

/**
******************************************************************************
*
* @file pipbee.c
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Main PipBee functions
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* OpenPilot Includes */
#include "pipbee.h"
/* Global Variables */
/* Local Variables */
/* Function Prototypes */
/**
* PipBee Main function
*/
int main()
{
uint32_t loop_ctr = 0;
uint32_t loop_ctr2 = 0;
// Brings up System using CMSIS functions, enables the LEDs.
PIOS_SYS_Init();
// Delay system
PIOS_DELAY_Init();
// Communication system
PIOS_COM_Init();
// ADC system
PIOS_ADC_Init();
// SPI link to master
PIOS_SPI_Init();
// Main loop
while (1)
{
if (++loop_ctr > 10000000)
{
loop_ctr = 0;
if (++loop_ctr2 > 3) loop_ctr2 = 0;
switch (loop_ctr2)
{
case 0:
PIOS_LED_Toggle(LED1);
break;
case 1:
PIOS_LED_Toggle(LED2);
break;
case 2:
PIOS_LED_Toggle(LED3);
break;
case 3:
PIOS_LED_Toggle(LED4);
break;
default:
loop_ctr2 = 0;
PIOS_LED_Toggle(LED1);
break;
}
}
}
return 0;
}