Ah, finally fixed spektrum stuff. after PWM rewrite, spektrum init ended up before pwm init, so when rcReadRawFunc was assigned, it was always set to PWM. oops. Thanks to Cerberis @ irc for the patch.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@240 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop@gmail.com 2013-01-05 01:13:18 +00:00
parent 006e6629f6
commit bd08f337e7
2 changed files with 3064 additions and 3064 deletions

File diff suppressed because it is too large Load Diff

View File

@ -68,23 +68,6 @@ int main(void)
sensorsSet(SENSOR_ACC);
#endif
if (feature(FEATURE_SPEKTRUM)) {
spektrumInit();
rcReadRawFunc = spektrumReadRawRC;
} else {
// spektrum and GPS are mutually exclusive
// Optional GPS - available in both PPM and PWM input mode, in PWM input, reduces number of available channels by 2.
if (feature(FEATURE_GPS))
gpsInit(cfg.gps_baudrate);
}
#ifdef SONAR
// sonar stuff only works with PPM
if (feature(FEATURE_PPM)) {
if (feature(FEATURE_SONAR))
Sonar_init();
}
#endif
mixerInit(); // this will set useServo var depending on mixer type
// when using airplane/wing mixer, servo/motor outputs are remapped
if (cfg.mixerConfiguration == MULTITYPE_AIRPLANE || cfg.mixerConfiguration == MULTITYPE_FLYING_WING)
@ -112,9 +95,26 @@ int main(void)
pwmInit(&pwm_params);
// configure PWM/CPPM read function. spektrum will override that
// configure PWM/CPPM read function. spektrum below will override that
rcReadRawFunc = pwmReadRawRC;
if (feature(FEATURE_SPEKTRUM)) {
spektrumInit();
rcReadRawFunc = spektrumReadRawRC;
} else {
// spektrum and GPS are mutually exclusive
// Optional GPS - available in both PPM and PWM input mode, in PWM input, reduces number of available channels by 2.
if (feature(FEATURE_GPS))
gpsInit(cfg.gps_baudrate);
}
#ifdef SONAR
// sonar stuff only works with PPM
if (feature(FEATURE_PPM)) {
if (feature(FEATURE_SONAR))
Sonar_init();
}
#endif
LED1_ON;
LED0_OFF;
for (i = 0; i < 10; i++) {