PWM6+7/TIM3_CH3+4/PB0+PB1
Update software serial to monitor serial pins for signal changes instead
of periodically sampling pin signals.
When reading the data the timer used is syncronized to the falling edge
of the start bit which allows for better syncronisation at higher
speeds. The code has been tested OK from 1200 baud to 19200. 38400
baud was tested and partially usable but has been disabled because there
are too many transmit and receive errors, especially when transmitting
and receiving at the same time.
Due to the way a single timer is used for transmitting and receiving, if
data comes in while transmitting the system may incorrectly transmit a
short or long bit. However at 19200 and below this didn't cause a
problem in the limited testing I performed.
set motor_pwm_rate to some value > 500 (1000, 8000, 16000 etc works on my scope).
then the motor output can be used to directly drive brushed motor fets.
PWM is rescaled to 0-base in brushed mode, so all same values of min/maxthrottle apply.
althold should work better now, the PID settings are preliminary. There
is definetly room for improvement.
For aquiring your own PID settings set ALT_P = 0 and tune the VEL pid
until the copter only drifts a little from its position when you
activate althold. Then set ALT_P to a value where it holds the position
stable
If telemetry_switch=1 it change baudrate and protocol using aux channel, either it switch when armed/disarmed.
This allows to keep MSP serial while armed for BT dongle if needed.
I need to add a telemetry_switch conf or feature to solve enabling MSP over FRSKy with switch not activated when armed ( i.e. using bt serial for tuning sessions ), but it will break when not using telemetry switch.
Better to keep it like this for now.
see comments in code for things to fix. added new variable to cli, fixedwing_althold_dir (though its value isn't really clear, I think it should always be positive since servo direction mix is done later).