mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
imported STM32 multiwii port into baseflight dir
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@86 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
commit
d262c6e66c
128 changed files with 71076 additions and 0 deletions
56
main.c
Executable file
56
main.c
Executable file
|
@ -0,0 +1,56 @@
|
|||
#include "board.h"
|
||||
#include "mw.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
systemInit();
|
||||
|
||||
readEEPROM();
|
||||
checkFirstTime();
|
||||
|
||||
// configure features (TODO: pull them from eeprom)
|
||||
featureSet(FEATURE_VBAT | FEATURE_PPM);
|
||||
sensorsSet(SENSOR_ACC | SENSOR_BARO | SENSOR_MAG);
|
||||
|
||||
pwmInit(feature(FEATURE_PPM), false);
|
||||
|
||||
LED1_ON;
|
||||
LED0_OFF;
|
||||
for (i = 0; i < 10; i++) {
|
||||
LED1_TOGGLE;
|
||||
LED0_TOGGLE;
|
||||
delay(25);
|
||||
BEEP_ON
|
||||
delay(25);
|
||||
BEEP_OFF;
|
||||
}
|
||||
LED0_OFF;
|
||||
LED1_OFF;
|
||||
|
||||
// drop out any sensors that don't seem to work
|
||||
sensorsAutodetect();
|
||||
|
||||
// Init sensors
|
||||
if (sensors(SENSOR_BARO))
|
||||
bmp085Init();
|
||||
if (sensors(SENSOR_ACC))
|
||||
adxl345Init();
|
||||
// if this fails, we get a beep + blink pattern. we're doomed.
|
||||
mpu3050Init();
|
||||
|
||||
imuInit(); // Mag is initialized inside imuInit
|
||||
|
||||
previousTime = micros();
|
||||
calibratingG = 400;
|
||||
#if defined(POWERMETER)
|
||||
for (i = 0; i <= PMOTOR_SUM; i++)
|
||||
pMeter[i] = 0;
|
||||
#endif
|
||||
|
||||
// loopy
|
||||
while (1) {
|
||||
loop();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue