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.
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.
This resulted in the removal of duplicate logic, duplicate code and the
removal of a temporary buffer per-driver.
The NAZE specific sensor alignment is now contained within the core code
instead of in the drivers.
The sensor alignment is determines by the sensor initialisation code.
The alignment of sensor readings is now performed once and only by the
appropriate sensor code, see usages of alignSensors().
The acc/gyro/compass driver code is now more reusable since it has no
dependencies on the main code.
each. relocated acc_t/gyro_t from sensors_common.h into
drivers/accgyro_common.h since they define an interface and the
dependency was pointing the wrong way from the drivers.
baro_t/acc_t/gyro_t dependences are all now pointing the right way.
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.
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.
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.
clear what all gpio/ledring drivers need to compile and what was
unnecessarily included before.
In attempting this it was clear that ledring had a dependency on the
multiwii code, this was removed by passing the led status update method
the values it needs.
It also turned out that the ROLL/PITCH defines were coming from
rc_alias_e and much unrelated code is coupled to these defines. This
commit also includes some cleanups relating to that problem.