mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Configuration validation.
This enables a new feature setting for PARALLEL_PWM which is enabled by default. This starts to move much of the feature checking/excluding code that is littered through into a single place - validateAndFixConfig(). Since the config is known to be valid after the method is called other code can just get on with it's job instead of checking for confliciting features/settings.
This commit is contained in:
parent
0fd127bf60
commit
5c4bfd4e58
13 changed files with 269 additions and 193 deletions
|
@ -1,5 +1,6 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
@ -26,13 +27,15 @@ static uint32_t sumdChannelData[SUMD_MAX_CHANNEL];
|
|||
|
||||
static serialPort_t *sumdPort;
|
||||
|
||||
void sumdInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataPtr *callback)
|
||||
bool sumdInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataPtr *callback)
|
||||
{
|
||||
sumdPort = openSerialPort(FUNCTION_SERIAL_RX, sumdDataReceive, 115200, MODE_RX, SERIAL_NOT_INVERTED);
|
||||
if (callback)
|
||||
*callback = sumdReadRawRC;
|
||||
|
||||
rxRuntimeConfig->channelCount = SUMD_MAX_CHANNEL;
|
||||
|
||||
return sumdPort != NULL;
|
||||
}
|
||||
|
||||
static uint8_t sumd[SUMD_BUFFSIZE] = { 0, };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue