core.numRCChannels now set by RC drivers to show max inputs available.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@433 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
6bbc8fdb22
commit
37b73a057b
|
@ -254,7 +254,7 @@ static void ppmCallback(uint8_t port, uint16_t capture)
|
||||||
if (diff > 2700) { // Per http://www.rcgroups.com/forums/showpost.php?p=21996147&postcount=3960 "So, if you use 2.5ms or higher as being the reset for the PPM stream start, you will be fine. I use 2.7ms just to be safe."
|
if (diff > 2700) { // Per http://www.rcgroups.com/forums/showpost.php?p=21996147&postcount=3960 "So, if you use 2.5ms or higher as being the reset for the PPM stream start, you will be fine. I use 2.7ms just to be safe."
|
||||||
chan = 0;
|
chan = 0;
|
||||||
} else {
|
} else {
|
||||||
if (diff > 750 && diff < 2250 && chan < 8) { // 750 to 2250 ms is our 'valid' channel range
|
if (diff > 750 && diff < 2250 && chan < MAX_INPUTS) { // 750 to 2250 ms is our 'valid' channel range
|
||||||
captures[chan] = diff;
|
captures[chan] = diff;
|
||||||
if (chan < 4 && diff > failsafeThreshold)
|
if (chan < 4 && diff > failsafeThreshold)
|
||||||
GoodPulses |= (1 << chan); // if signal is valid - mark channel as OK
|
GoodPulses |= (1 << chan); // if signal is valid - mark channel as OK
|
||||||
|
|
|
@ -80,8 +80,9 @@ int main(void)
|
||||||
|
|
||||||
pwmInit(&pwm_params);
|
pwmInit(&pwm_params);
|
||||||
|
|
||||||
// configure PWM/CPPM read function. spektrum or sbus below will override that
|
// configure PWM/CPPM read function and max number of channels. spektrum or sbus below will override both of these, if enabled
|
||||||
rcReadRawFunc = pwmReadRawRC;
|
rcReadRawFunc = pwmReadRawRC;
|
||||||
|
core.numRCChannels = MAX_INPUTS;
|
||||||
|
|
||||||
if (feature(FEATURE_SERIALRX)) {
|
if (feature(FEATURE_SERIALRX)) {
|
||||||
switch (mcfg.serialrx_type) {
|
switch (mcfg.serialrx_type) {
|
||||||
|
|
|
@ -26,6 +26,7 @@ void sbusInit(rcReadRawDataPtr *callback)
|
||||||
core.rcvrport = uartOpen(USART2, sbusDataReceive, 100000, MODE_RX);
|
core.rcvrport = uartOpen(USART2, sbusDataReceive, 100000, MODE_RX);
|
||||||
if (callback)
|
if (callback)
|
||||||
*callback = sbusReadRawRC;
|
*callback = sbusReadRawRC;
|
||||||
|
core.numRCChannels = SBUS_MAX_CHANNEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sbus_dat
|
struct sbus_dat
|
||||||
|
|
|
@ -37,6 +37,7 @@ void spektrumInit(rcReadRawDataPtr *callback)
|
||||||
core.rcvrport = uartOpen(USART2, spektrumDataReceive, 115200, MODE_RX);
|
core.rcvrport = uartOpen(USART2, spektrumDataReceive, 115200, MODE_RX);
|
||||||
if (callback)
|
if (callback)
|
||||||
*callback = spektrumReadRawRC;
|
*callback = spektrumReadRawRC;
|
||||||
|
core.numRCChannels = SPEK_MAX_CHANNEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Receive ISR callback
|
// Receive ISR callback
|
||||||
|
|
Loading…
Reference in New Issue