This rearranges Makefile a bit and enables Link Time Optimisation
which leads to a smaller code (77724 text with gcc 4.7.3).
Unconditionally adding -ggdb3 doesn't affect code size anyhow as all
the debugging info is stored in separate sections.
Build-tested only.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Conflicts:
Makefile
Output files were being left in the working directory.
Build needs to be tested on cygwin, if it fails find a different
solution or revert this commit.
Added documentation.
Added LED_STRIP feature, can only be enabled under certain circumstances
depending on target due to pin/timer mappings - see documentation.
This is an alternative to #ifdef's everywhere which is getting out of
hand.
Confirmed that the VCP is working on the STM32F3Discovery board and
ChebuzzF3 variant.
Latest naze binary.
Removing other binaries, git repo isn't really the place to store
binaries and they keep getting in the way. This is will be kept here
until the configurator is updated.
The primary reason is to support the D4R-II with it's much faster PWM
frequency. The PWM RSSI code could not keep up, and since there are no
timers free for using capture compare of PWM signals in hardware one
solution is to use the ADC at a slow sample rate.
RC2 is used as before and it expects a signal between 0 and 3.3v. An
inline smoothing capacitor may help.
This commit also removes the cli command adc_power_channel since the
reading was never actually exposed anywhere.
Also support FrSky 1khz RSSI. See documentation also added in this
commit.
This commit also cleans up the PWM mapping code. 'mask' didn't need to
be a mask and it wasn't possible to add another 'type' since there were
only 4 possible values when it was a mask and they were already defined.
Combined with switching to using 16 bits instead of 8 for the mapping
configurations, it's now possible to have 256 types instead of 4 at the
expense of a few bytes of flash.
Moved the RSSI calculation into rx_common.c, previously it was in the
main loop.
Decoupled mpu6050 acc and gyro detection code.
This commit cleans up the #ifdef/#ifndef code which, due to the amount
of targets and variants, was starting to get a bit out of hand.
Now each acc & gyro is assumed to be used unless the respective
USE_ACC_* and USE_GYRO_* is #undef'd at the top of the file by a
particular target.
This commit also cleans up the mess of re-running all the mpu6050
detection code twice. Now the acc specific communication code is only
run once and only code that is actually needed to be run twice is run
twice, and the rest of the code is now only used once. This will
improve board startup time, albeit negligibly.
Sensor alignment is only known for the NAZE target so now the alignment
will be ALIGN_DEFAULT for all targets other than NAZE unless they are
known.
Finally, in the Makefile a file was included twice in the source list
for the STM32F3DISCOVERY target and now additional sensors are supported
for users that may want to try them on that board.
By decoupling everything the structures now only contain members they need. The mapping code is simplified. The calculation of timer periods is now where it belongs (with the output code, not with the mapping code). Also, since each motor output has it's own callback method it is technically possible to mix brushed and brushless motors if the brushed motors and brushless motors use different timers. Additional code would be required to fully support that.
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.
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.
channels when using Spektrum 2048 - untested. Renamed and extracted
core_t.numRCChannels to rxConfig.channelCount so that future commits can
clean up core_t further since core_t contains completely unrelated
properties.
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.
Keil project not updated, I have no way to verify it.
Note, mw.c, drv_pwm.c and drv_system.c contain code for too many topics.
Later commits will relocate the code as appropriate.
Not even looked at utils yet. 'Utils' is a bad naming practice and is a
synonym for 'too lazy to find the right file/name'.
First cut at polymorphic serial port implementation. Split serialPort_t into uartPort_t and serialPort_t. Calls to uartWrite() can now be replaced with calls to serialWrite().
Replacing calls to serialWriteByte(softSerial_t*, char) with calls to serialWrite(serialPort_t*, char). This completes the proof of concept for polymorphic serial port implementations (uartPort and softSerialPort).
Renaming isSerialAvailable to uartTotalBytesWaiting. Renaming serialAvailable to softSerialTotalBytesWaiting. Adding serialTotalBytesWaiting to serial API and updating calls to the former methods to use the serial API.
Renaming serialRead to softSerialRead. Adding serialRead to serial API and updating calls to uartRead and softSerialRead to use the serial API. Renamed uartPrint to serialPrint which now works on any serialPort implementation.
Replacing calls to isUartTransmitEmpty with isSoftSerialTransmitBufferEmpty. Replacing remaing calls to uartWrite with serialWrite. Adding isSoftSerialTransmitBufferEmpty to the serial API. Adding serialSet/GetBaudRate to the serial API. Since softSerial does not implement serialSetBaudRate some GPS serial initialisation code has been updated.
At this point it is probably possible to switch around all the ports and use a software serial implementation if desired.
By Dominic Clifton / https://github.com/hydra/baseflight/
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@423 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
FEATURE_SPEKTRUM has been removed and replaced with FEATURE_SERIALRX.
cli option serialrx_type now configures what type of receiver it is
0 = spektrum1024, 1 = spektrum2048, 2 = sbus
sbus will need hardware inverter to use.
also cleaned up receiver drivers to assign readrawRC callback instead of assigning in code in main()
none of this has been tested.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@418 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
documented L3G4200D driver why 0x28 read was suddenly turning into 0xA8
removed old wiimotion averaging cruft from computeIMU
NOT FLIGHT TESTED
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@403 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
PWM and ADC configuration is the same as the naze32 for now. Requires an accelerometer is connected via I2C2.
I2C signals SDA2 and SCL2 are on the UEXT header (Pins 6 and 5 respectively)
USART signals TX and RX are on the CON3/CON4 headers (TX = D7, RX = D8)
Onboard LEDs (LED1/LED2) working.
Buzzer support removed for now as it conflicted with PWM map and LEDs.
mma845x support disabled as it conflicted with an LED.
Relocated some NAZE specific comments.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@302 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
added ms5611 driver
refactored pressure sensor subsystem to allow multiple sensors
couple changes in PWM driver to make motor/servo arrangement for airplane mode more intuitive
moved MAX_MOTORS/MAX_SERVOS etc into drv_pwm.h
staring to merge back in airplane/flyingwing mixes
fix for tri servo display - mwc moved it to servo[5] again, gui was broken, function not.
will probably implement custom mixer soon (motors only, no servos)
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@198 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
increased flash size to 128k, moved config data in last kbyte of that. as a result all settings are reset, please save them.
corrected hex6x mixer.
added telemetry to makefile.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@180 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61