The index is not really a user concern and leads to confusion. gps
baudrate is not set like any other baud date and the determination of an
appropriate index is hidden from the user.
If the user specifies a baudrate that is not supported the default index
is used which is current the index for 115200.
This also allows GPS to work on softserial ports at up to 19200.
systems and Parallel PWM/PPM systems.
Added setting for failsafe_max_usec. Renamed failsafe_detect_threshold
to failsafe_min_usec.
Failsafe now detects when a PPM/PWM RX isn't sending ANY data out on
CH1-4. See documentation notes regarding Graupner receivers in
Failsafe.md.
Documented failsafe system.
own dedicated serial port.
Added a feature to enable/disable RX_MSP.
Renamed feature SERIALRX to RX_SERIAL.
Renamed feature PARALLEL_PWM to RX_PARALLEL_PWM
Renamed PPM to RX_PPM.
Update serial configuration checking to better support Serial RX and
telemetry by verifiying serial port features and supported baud rates.
It's now possible to use a low-speed serial rx provider via softserial -
only problem is all the current serial rx providers are 100000/115200
baud. The code changes however open the door for using serial rx and
any capable serial port such as uart3-5 on the STM32F30x
It's also now possible to use GPS at low speeds on software serial
ports.
match the comment from pullrequest about spacing
remains : some hand alignment for comment and wrong /** */ usage.
Conflicts:
src/board.h
src/buzzer.c
src/config.c
src/drivers/serial_common.h
src/drivers/system_common.c
src/drv_gpio.h
src/drv_pwm.c
src/drv_timer.c
src/drv_uart.c
src/flight_imu.c
src/mw.c
src/serial_cli.c
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.
Currently port usage is hard-coded to the default port layout, cli
commands are coming in a future commit.
This decouples all code from the global 'serialPorts' structure which
has been removed. Any code that needs to use a serial port can use
findOpenSerialPort() and openSerialPort() and maintain it's own
reference to the port.
Ports can switch between functions. e.g. by default
cli/msp/telemetry/gps
passthrough all use USART1. Each port maintains it's current function.
see begin/endSerialPortFunction.
There are only certain combinations of serial port functions that are
supported, these are listed in serialPortFunctionScenario_e.
This commit also adds a few 'static' keywords to variables that should
have been.
There a a few other minor fixes and tweaks to various bits of code that
this uncovered too.
This is a large commit, from the commit it is clear that the mixer has
many dependencies, this is expected since it is central to the
application.
To achieve the decoupling many master config and profile members had to
be moved into structures.
Relocated throttle/pitch curves into rc_curves.c/h since it has nothing
to with rx code, this fixed the dependencies inside the rx provider
files.
Rename yawdeadband to yaw_deadband to match other variables/cli
commands.
Fix a couple of usages of MAX_MOTORS where MAX_SUPPORTED_MOTORS should
be used instead.
In doing so accelerometer sensor and trim code had to be cleaned.
Added a new method to buzzer.c to avoid exposing toggleBeep.
Renamed current_profile to current_profile_index to avoid confusion.
Moved some GPS code from mw.c into gps_common.c.
Moved pid values into a pidProfile_t structure; this was done so that
gps_common.c does not have a dependency on config_profile.h.
pidProfile_t lives in flight_common.h now.
Moved gps profile settings from profile_t into gpsProfile_t for the same
reason.
Removed gps_common.c's dependency on masterConfig_t by passing needed
variables into gpsInit().
separate concerns and help reduce and clarify dependencies.
cfg and mcfg are too similarly named and are not obvious. Renamed cfg
to currentProfile and mcfg to masterConfig. This will increase source
code line length somewhat but that's ok; lines of code doing too much
are now easier to spot.
the code is doing. There are now no EEPROM read/write/reset/verify
methods that take any arguments which removes magic boolean variables
from method signatures.
This also removes duplicate code in the cliDefaults and cliSave commands
which results in smaller code also also due to the deduplication of a
reboot message.
only what it's name implies and it's method takes no arguments. This
avoids the 0/1 magic numbers which was a flag to decide whether the user
should be notified after the EEPROM has been read (!).
Introduced a method called readEEPROMAndNotify() which is used in all
cases where writeEEPROM(1) was previously called.
Additionally this avoid re-reading the profile when the reboot command
is issued which speeds up reboots.
Finally this avoid needless comments because the code tells you now what
it is going to do.
serial_common.c/h. decouple runtime_config from serial ports. decouple
buzzer from serial ports. decouple opening of the main serial port from
the msp code. decouple serial rx providers from runtime_config. rename
core_t to serialPorts_t since it only contained serial ports. It's now
clear which files use serial ports based on the header files they
include.
of determining a revision code. Previously there was mpu6050 specific
code in cli.c (the status command).
Finally this commit has removed all non-serial port configuration
settings from core_t so that a future commit can refactor core_t to
reduce dependencies on serial port code.
In doing this I also noted from other source code that the MPU6050
accelerometer trim for some revisions appeared to be incorrectly set to
255 * 8 instead of 256 * 8.
code into rx_common.c. Moved some GPS code into gps_common.c. Isolated
some GPS functions into gps_common.c that were called from mw.c/loop().
moved gimbal defines into gimbal.h. Moved sound & light code into
statusindicator.c
remove dependency on board.h and mw.h on a few files.
Moved rx configuration paramaters into rxConfig in order to remove the
dependency on config_t from the sbus rx code - sumd/spektrum to follow.
Avoided use of YAW/PITCH/ROLL in some files since those constants are
from an unrelated enum type.
Replaced some magic numbers with constants to remove comments and
improve code readability.
Note, due to the tight coupling and global variable usage it was
difficult to create a smaller commit.
This fixes a bug where buzzerFreq could be uninitialised before it's
use.
This improves performance by only checking whether to sound the battery
alarm after the battery voltage has been recalculated.
There were unused battery beep codes which have been deleted to save
code size.
Configuration structure extracted from mw.h into config.h.
Moved mixer configuration structures into flight_mixer.h.
Added a build_config.c in order to decouple pwm_common.h from config.h.
Finally, battery configuration values now live in a batteryConfig
structure which means that battery.c does not depend on config.h and all
of it's dependencies.
Fixed the use of plurals on defines that were not collection objects.
PIDITEMS and CHECKBOXITEMS are now PID_ITEM_COUNT and
CHECKBOX_ITEM_COUNT.
do not include "board.h". It is now clear what all ADC drivers need to
compile and what was unnecessarily included before.
Note: FY90Q make target now compiles successfully, it was broken for
various reasons before.