Commit Graph

1341 Commits

Author SHA1 Message Date
Andrew Tridgell d5b619218c DCM: use rotation_matrix_from_euler() to calculate initial yaw
When we first get a compass reading or we first start motion we need
to setup the DCM matrix with the right yaw. This uses
rotation_matrix_from_euler() to get a DCM matrix corresponding to our
current roll/pitch, but with the correct yaw
2012-02-25 11:37:20 +11:00
Andrew Tridgell 48cad8bc25 DCM: use rotation_matrix_from_euler() in matrix reset
this makes the code a bit easier to read
2012-02-24 11:54:11 +11:00
Andrew Tridgell 5009679617 DCM: use calculate_euler_angles() to get eulers from DCM
this makes the code a bit easier to understand
2012-02-24 11:52:55 +11:00
Andrew Tridgell df6013616e AP_Math: added rotmat <-> euler functions
these will make the dcm matrix manipulation easier to understand
2012-02-24 11:52:55 +11:00
Andrew Tridgell 50f85835bd Compass: ensure we don't produce NAN values for compass heading
this leaves the previous heading values alone if we are at a pitch of
exactly 90 or -90, at which point we can't compute a meaningful
heading
2012-02-24 11:52:55 +11:00
Andrew Tridgell 8190204287 AP_Math: added safe_sqrt() function
this function will never return NAN. It will return zero for negative
numbers.
2012-02-24 11:52:55 +11:00
Andrew Tridgell 0acea11152 DCM: tidy up the nan checking in DCM
use is_nan() on the matrix rather than just on c.x, and add
safe_asin() to the (unused) OUTPUTMODE==2 code.
2012-02-24 11:52:55 +11:00
Andrew Tridgell b4c8d6491a DCM: added matrix recovery on reset
when we get a bad DCM error we can recover a matrix corresponding to
the current attitude, making it more likely that the aircraft will be
able to recover
2012-02-24 11:52:55 +11:00
Andrew Tridgell 1a32ececb4 AP_Math: added a safe_asin() function
this adds range checking to asin()
2012-02-24 11:52:55 +11:00
Andrew Tridgell 7dd909a16b AP_Math: added is_nan() methods to vector3f and matrix3f 2012-02-24 11:52:55 +11:00
Jason Short 2a4b7facaa added set integrator 2012-02-23 09:38:08 -08:00
Andrew Tridgell 8707965c15 DCM: changed the sense of floating point range comparison
This allows us to detect NaN, otherwise NaN values were considered 
'in range'
2012-02-23 11:41:26 +11:00
Andrew Tridgell 9caa4aeb44 DCM: range check the matrix before calculating pitch
The asin() in the pitch calculation can only take values between -1
and 1. This change ensures that the value is in range, and if it isn't
then we force a normalization. If that fails we reset the matrix
2012-02-23 08:16:08 +11:00
Andrew Tridgell 13693e1a04 DCM: reset more values on renorm blowup
when DCM blows up, we need to reset a lot more variables to ensure
that any NaN values don't persist
2012-02-23 08:16:08 +11:00
Andrew Tridgell 5cfe1ad5dc DCM: remove the taylor expansion optimisation for renormalisation
The sqrt() costs about 44usec on a 2560, which is small enough for us
not to worry about the speed.

This also changes the range of values where we declare a blowup to
much less likely, which means we can cope with larger delta_t glitches
2012-02-23 08:16:08 +11:00
Andrew Tridgell f30c721886 AP_Param: added ParamToken type for variable list traversal 2012-02-19 17:05:28 +11:00
Jason Short 669e8e34ea added a limit to range output 2012-02-18 21:08:17 -08:00
Randy Mackay 0b369cf78b Optflow - added reference to FastSerial to resolve compile error on Arduino 1.0.
also removed reference to DCM (no longer required) and removed some old code.
2012-02-18 18:09:40 +09:00
Andrew Tridgell 2472f0a2f3 SITL: increase the amount of noise in the simulated ADC
this increases the noise to 2 bits, which actually can have the effect
of improving accuracy, as it leads to better averaging
2012-02-18 19:27:15 +11:00
Andrew Tridgell 9602b1f91b DCM: only add in centripetal accel if we have GPS lock
if we don't have a GPS or the GPS doesn't have a good lock then we
can't rely on the ground speed for adjusting the acceleration vector
2012-02-18 19:27:15 +11:00
Andrew Tridgell 371a91cfcf IMU: move _sensor_cal to general IMU class
this makes it available both in shim and INS subclasses
2012-02-18 10:51:57 +11:00
Andrew Tridgell 2b8f0c3a48 AP_Param: moved AP_Vector3f and AP_Matrix3f declarations to AP_Math.h
this avoids us needing AP_Math.h in every utility sketch and example
2012-02-18 10:51:57 +11:00
Andrew Tridgell 70a135c47c AP_Param: fixed copy-assignment operators for AP_Param vectors 2012-02-18 10:51:57 +11:00
Andrew Tridgell e656928c01 AP_Param: added a set_and_save_ifchanged() method
this can be used to avoid the scan() in more frequenctly saved
variables, such as the MAVLink stream rates in APM
2012-02-18 10:51:57 +11:00
Andrew Tridgell 6f080742b8 AP_Param: added an initialised() method
this will be used by the compass code
2012-02-18 10:51:57 +11:00
justinbeech 5255512bf9 Found free extra 256 bytes of RAM eliminate _clz use from libgcc
Believe it or not, changing / 2^31 to >>31 saved 256 bytes in the "d" segment.

The reason is that GCC version prior to 4.3.5 does not have a count_leading_zeros (clz) assembler macro, so it uses a 256 byte lookup table called _clz
The _clz table gets pulled in if you do 64 bit division.
This tiny change is the only place that we do long long division.
Changing to a shift saves 256 bytes of ram.
2012-02-17 09:46:05 +00:00
Jason Short 560985b509 made I term return in same pattern as D term 2012-02-16 22:09:22 -08:00
Andrew Tridgell 3fbb5a2d6c ADC: on channel overflow we should not zero last_ch6_micros
this happens every 64 seconds because of unused channels on the
ADC. Zeroing this creates a bad delta_t value for the DCM code.
2012-02-16 17:48:36 +11:00
Jason Short 8e88d9e19e change constant to float 44330.0 2012-02-15 09:10:14 -08:00
Michael Oborne b020a87c13 eedump ap param in perl 2012-02-15 21:31:58 +08:00
Andrew Tridgell bc89b53bdc SITL: adjust the SITL compass code to have saner z values 2012-02-15 22:34:16 +11:00
Andrew Tridgell 63d768143d Compass: enable compass offsets for HIL compass
this makes the null_offsets algorithm have an effect for the HIL
compass that is used for SITL, which makes for easier testing of
compass calibration
2012-02-15 22:33:50 +11:00
Andrew Tridgell 7d21692301 fixed dump size 2012-02-15 10:44:09 +11:00
Andrew Tridgell d2cc6740f0 show group_element too 2012-02-15 10:42:21 +11:00
Andrew Tridgell aaba4db144 AP_Param: added eeprom_aaparam.c dump utility 2012-02-15 10:41:06 +11:00
Andrew Tridgell 812b7ae5ae SITL: catch floating point errors
if we get a FPE then log a message and exit
2012-02-15 08:50:45 +11:00
Andrew Tridgell c39914e734 DCM: added a SITL_debug() for DCM normalisation errors
I have seen normalisation errors during simulation runs, but have not
yet tracked down the cause. This log message may help track things
down.
2012-02-15 08:50:45 +11:00
Andrew Tridgell 7355f5613c added SITL_debug() macro
this can be used to print a message into the logs in the SITL
simulator. This will be used for critical conditions.
2012-02-15 08:50:45 +11:00
Andrew Tridgell 7ba65aecf3 RC_Channel_aux: fixed a uninitialied variable error, and save a bit of stack space 2012-02-15 08:50:45 +11:00
Andrew Tridgell 273a974814 SITL: add some magnetometer offsets
this ensures the compass null_offset algorithm has some work to do in
autotest
2012-02-14 11:26:42 +11:00
Andrew Tridgell 9103f7688c fixed SITL GPS heading to be 0..360 2012-02-14 11:26:42 +11:00
Andrew Tridgell a1c041b597 use stdint types in the compass code 2012-02-14 08:35:03 +11:00
Andrew Tridgell 6c20ff9492 AP_Param: allow dumping of AP_Vector3f
this means the 'show' command in the CLI shows the compass offsets now
2012-02-14 08:34:50 +11:00
Andrew Tridgell 4ec3857476 GPS: change back to 4Hz for MTK GPS
this will hopefully fix the NO_GPS problems that have been regularly
happening in recent months. I will watch the logs carefully to see if
the problem recurs
2012-02-13 22:50:20 +11:00
Andrew Tridgell e70e1814ac AP_Baro: fixed some signed/unsigned warnings
and a potential bug on timer wrap
2012-02-13 21:39:18 +11:00
Andrew Tridgell 550b0be231 move AP_Var code and example into libraries/AP_Var
you can use AP_Var by defining USE_AP_VAR
2012-02-13 16:22:53 +11:00
Andrew Tridgell e7e7450f90 fixed imax load/save in PID 2012-02-13 16:22:53 +11:00
Andrew Tridgell c497ad9b7e fixed dead zone load/save 2012-02-13 16:22:53 +11:00
Andrew Tridgell 845d056c18 fixed PID initialisation 2012-02-13 16:22:53 +11:00
Andrew Tridgell c6b6898266 RC_Channel_aux: catch invalid function settings
a bad function setting would overwrite the heap
2012-02-13 16:22:53 +11:00
Andrew Tridgell d41c56214c fixed types in GPS detect code
using int everywhere is wasteful and non-portable
2012-02-13 16:22:53 +11:00
Andrew Tridgell 16a5b5c3ee added AP_Param::show_all()
this moves the logic into common code
2012-02-13 16:22:52 +11:00
Andrew Tridgell ee2cb32a44 change back to 256 max variables in _var_info[]
this keeps the header to 24 bits, and allows the token to be 16
bits. If we need more variables we can put them in a nested group.
2012-02-13 16:22:52 +11:00
Andrew Tridgell 6cf7015859 added indexes to group info structures 2012-02-13 16:22:52 +11:00
Andrew Tridgell 7621b96a52 AP_Param: added group idx, and change packing of header elements
adding a idx element to the GroupInfo will make it less likely that a
developer will change the IDs of group elements, and make it easier to
see that these IDs are important for identifying a variable in EEPROM

The header packing has changed to make it 24 bits on all platforms,
which allows us to lower the EEPROM variable max size to 1024 bytes
again
2012-02-13 16:22:52 +11:00
Andrew Tridgell 711cee9dfa fixed support for AP_PARAM_SPARE
spare group elements are needed if we remove a group parameter
2012-02-13 16:22:52 +11:00
Andrew Tridgell db8a58f994 fixed build on arduino 1.0 2012-02-13 16:22:52 +11:00
Andrew Tridgell 170fdef857 convert APM_PI library to AP_Param 2012-02-13 16:22:52 +11:00
Andrew Tridgell 74e0d2ef2a convert AC_PID library to AP_Param 2012-02-13 16:22:52 +11:00
Andrew Tridgell 4a9cb731d4 fixed missing return in D value 2012-02-13 16:22:52 +11:00
Andrew Tridgell c4b7a3116a restore _fCut that was lost in AP_Param development 2012-02-13 16:22:51 +11:00
Andrew Tridgell df77c462a4 fixed initialisation of RC_Channel class 2012-02-13 16:22:51 +11:00
Andrew Tridgell 244d2055ff AP_Param: fixed desktop build 2012-02-13 16:22:51 +11:00
Andrew Tridgell c195be594a desktop: more progmem string functions 2012-02-13 16:22:51 +11:00
Andrew Tridgell 34bc88eab5 AP_Param: added generic cast_to_float 2012-02-13 16:22:51 +11:00
Andrew Tridgell a1057fe738 AP_Param: disable debug ready for production 2012-02-13 16:22:51 +11:00
Andrew Tridgell 7ffb9b462d AP_Param: make ptype in first() and next() optional 2012-02-13 16:22:51 +11:00
Andrew Tridgell 5c3e059eea adapt Mavlink_compat.h to AP_Param 2012-02-13 16:22:51 +11:00
Andrew Tridgell dff75dba96 convert libraries to new typesafe macros 2012-02-13 16:22:51 +11:00
Andrew Tridgell b6ee5ca982 added nested group support and validation 2012-02-13 16:22:51 +11:00
Andrew Tridgell 30c76664ce added size of Vector6f 2012-02-13 16:22:51 +11:00
Andrew Tridgell fc0f1c52ca modify RC_Channel for AP_Param 2012-02-13 16:22:51 +11:00
Andrew Tridgell 013d66527d modify the PID library for AP_Param 2012-02-13 16:22:51 +11:00
Andrew Tridgell 78564f6a92 modify the IMU code for AP_Param 2012-02-13 16:22:51 +11:00
Andrew Tridgell 32d997b95f modify the compass code for AP_Param 2012-02-13 16:22:51 +11:00
Andrew Tridgell 2154288e2b hacks to get AP_Param to compile 2012-02-13 16:22:50 +11:00
Andrew Tridgell 937f8a4741 new AP_Param subsystem 2012-02-13 16:22:50 +11:00
justinbeech 4b0c71d6ac Uncommented cold temp compensation after testing. Fixed read throttle so read rate ends up nailing 100hz, not 90hz. minor commenting improvements. 2012-02-13 00:00:06 +00:00
analoguedevices a07f37f1b4 Removed outdated comment:
"	// deadzone moved to
		//control_in = (abs(control_in) < _dead_zone) ? 0 : control_in;"
2012-02-11 16:51:02 +00:00
Michael Oborne 651bd6953b fix uint > int issue - for hil 2012-02-11 11:35:59 +08:00
Pat Hickey fb76aa9ca9 APM_RC_APM2: Add support for CH_10 and CH_11
* CH_10 is on APM2 pin A10 (based on A1..A8 convention)
* CH_11 is on APM2 pin A11

* Only the code in enable_out, disable_out, and OutputCh needed to change.

* CH_10 and CH_11 always have an output period of 20ms (50Hz).
2012-02-06 22:11:01 -08:00
Randy Mackay 2f25c1f9f1 AC_PID Library - added example sketch 2012-02-05 17:35:15 +09:00
Randy Mackay a694e16540 APM_PerfMon - removed because it's too big to use with our limited memory now anyway! I have a backup in case we need to resurrect it in the future. 2012-02-05 11:11:59 +09:00
Jason Short 5185901f79 Added D term to APM_PI - need to refactor this as a parent class and two child classes to save code space, remove dupes 2012-01-28 21:21:43 -08:00
Randy Mackay b543bbf514 Arduino 1.0 - GPS_IMU - small fix to make it compile. Does anyone use this lib?! 2012-01-28 17:56:56 +09:00
Randy Mackay 8bcc567406 AP_PID, AP_RC_Channel, FastSerial - small changes to make example sketches compile again 2012-01-28 17:54:20 +09:00
Randy Mackay 2e1e34fb9c Arduino 1.0 - small fix to make AP_Baro_MS5611_test.pde compile under Arduino 1.0 2012-01-28 13:21:35 +09:00
Randy Mackay 52f6e56f72 AP_ADC library - tiny fix to make example sketch work after some changes to AP_PeriodicProcess library 2012-01-28 13:12:19 +09:00
Randy Mackay 98f3386ea0 Arduino 1.0 - changed all #includes of "WProgram.h", "wiring.h" and "WConstants.h to "Arduino.h".
Modified FastSerial's write function to return size_t (number of bytes written).
2012-01-28 12:25:47 +09:00
Randy Mackay 443a9c0ea7 OpticalFlow - fixed minor compiler warnings and moved chip select to A3 for APM2 2012-01-26 23:35:49 +09:00
Randy Mackay f27b41179b Sonar - changed default pin to A0 2012-01-26 22:50:48 +09:00
Randy Mackay 13caa24515 Optical Flow - added overflow check 2012-01-25 21:45:52 +09:00
Pat Hickey ef60642bb2 APM_RC examples: add calls to enable_out after init 2012-01-24 09:09:08 -08:00
Andrew Tridgell 9bb92ff4ac fixed example in PID library 2012-01-23 08:47:46 +11:00
Pat Hickey a13e371d1e APM_RC: PWM outputs are disabled by default on init 2012-01-22 12:03:11 -08:00
Pat Hickey 47204921e9 APM_RC enable_out and disable_out added to APM1 and APM2
* Outputs still enabled by default
2012-01-22 12:03:11 -08:00
Jason Short 0e58efca89 Removed Gyro filter, In the end it doesn't help and I think it could actually hurt gyro integration. 2012-01-20 22:52:29 -08:00
Michael Oborne e71266c258 change rc norm_output to scale evenly across the entire range 2012-01-20 16:24:55 +08:00
Andrew Tridgell 20aef3a8b8 added a simple DCM library example 2012-01-18 21:25:19 +11:00
Andrew Tridgell 4b8e2e701c fixed Oilpan test for new library structure 2012-01-18 20:31:58 +11:00
Doug Weibel e109992c12 Add a CLI setup action to reset the magnetometer offsets
Since the magnetometer offsets are not available through the MAVLink parameter interface (since they are an AP_Var vector) this little feature allows them to be reset from the CLI.  Useful if you somehow get bad offsets or if you change magnetometer.  If you have a bad set of large offset values I have seen issues with the nulling algorithm have trouble converging to the proper values.  I have never seen it have trouble converging from 0/0/0, so this could be a useful feature from time to time.
2012-01-15 16:15:08 -07:00
Mike Smith d79f62ce66 Teach the Makefile about the new Arduino sourcefile suffix 2012-01-15 11:51:38 -08:00
Jason Short e68f9191c9 updated channel notes 2012-01-15 10:24:15 -08:00
Andrew Tridgell 817e7442bd baro: fixed an integer overflow issue at high altitudes
the averaging array was using 16 bit numbers, but we are storing
numbers with 19 significant bits. That caused overflow at high
altitude, and some very interesting altitude graphs!

Thanks to Michael Oborne for spotting this in a log
2012-01-14 19:51:35 +11:00
Randy Mackay 4e9c668315 OpticalFlow - bug fix - highest resolution was incorrectly set as 1200 instead of 1600 2012-01-14 12:34:29 +09:00
Andrew Tridgell f4490b62c7 DCM: prevent a segmentation fault when compass is not enabled
when compass is disabled _compass is NULL
2012-01-13 15:48:07 +11:00
Doug Weibel 622217357c Bug fix for compass.
This is a fix for an interesting bug when a DCM matrix reset was added to the ground start.  This bug only showed up if (A) a ground start were performed after an air start or due to use of the "Calibrate Gryo" action, (B) if the current orientation were sufficiently different from 0/0/0, and (C.) if the particular magnetometer had sufficiently large offsets.  Why did resetting the DCM matrix to 0/0/0 pitch/roll/yaw at ground start cause a bug?  The magnetometer offset nulling determines the proper offsets for the magnetometer by comparing the observed change in the magnetic field vector with the expected change due to rotation as calculated from the rotation in the DCM matrix.  This comparison is made at 10Hz, and then filtered with a weight based on the amount of rotation to estimate the offsets. Normally it would take considerable time at normal in-flight rotation rates for the offset estimate to converge. 

If a DCM matrix reset occurs when the offset nulling algorithm is up and running, the algorithm sees the DCM reset as a instantaneous rotation, however the magnetic field vector did not change at all.  Under certain conditions the algorithm would interpret this as indicating that the offset(s) should be very large.  Since the "rotation" could also have been large the filter weighting would be large and it was possible for a large erroneous estimate of the offset(s) to be made based on this single (bad) data point.

To fix this bug methods were added to the compass object to start and stop the offset nulling algorithm.  Further, when the algorithm is started, it is set up to get fresh samples.  The DCM matrix reset method now calls these new methods to stop the offset nulling before resetting the matrix, and resume after the matrix has been reset.
2012-01-12 14:44:24 -07:00
Andrew Tridgell a6e87915eb desktop: floating point precision changes from Justin Beech 2012-01-11 21:31:59 +11:00
Jason Short f43c29e840 fixed type error 2012-01-10 23:43:44 -08:00
Jason Short ecaf5ac461 sensorSign swicth 2012-01-10 23:43:44 -08:00
Jason Short d7d04f67e4 AP Rangefinder had some bad characters in it. Converted and cleaned the text files. 2012-01-10 23:42:26 -08:00
Jason Short 9cbfcac802 Made timer unsigned 2012-01-10 23:42:26 -08:00
Pat Hickey d015e0d6d9 APM_RC & ArduCopter: Change interface to SetFastOutputChannels to use _BV
* Every use of MSK_CH_n changed to _BV(CH_n)
* Easier to read, and will allow CH_n to be parameterized without needing
  a separate macro expansion for the MSK value.
2012-01-09 21:57:01 -08:00
Doug Weibel 22d2db53d8 Repair dataflash test 2012-01-08 21:29:19 -07:00
Jason Short f6e268395f allows main code to manually set the integrator value 2012-01-04 09:28:36 -08:00
Andrew Tridgell 54b91ce2f4 sitl: added build targets for different ACM frames 2012-01-04 21:45:46 +11:00
Andrew Tridgell 7aa294eca2 AP_Compass: when I2c fails, don't retry for 1s 2012-01-04 16:35:47 +11:00
Andrew Tridgell a7a00a35ab AP_Baro: when I2c fails, don't retry for 1s 2012-01-04 16:35:16 +11:00
Andrew Tridgell 65fbeea6d1 DataFlash: cope with older dataflash chips
some of the APM2 DataFlash cards use an older chip with only 4096
pages, and a density code of 6. Doug has one of these.
2012-01-04 16:16:35 +11:00
Michael Oborne 6a279138e9 add gps character count.
this problem happens when the mtk ends up in nmea mode at 10hz. there is no 50ms window of no activity
2011-12-31 13:05:33 +08:00
Michael Oborne e66e21cf20 remove gps callback in wait loop 2011-12-31 09:35:40 +08:00
Randy Mackay 19ed12444b GPS - removed GPS_MTK, GPT_NMEA and GPS_UBLOX. All functionality moved to AP_GPS many months ago. 2011-12-30 22:25:00 +09:00
Jason Short 3878ac01ef removed newlines to clean up code 2011-12-29 23:02:01 -08:00
Randy Mackay ff66a3417c OptFlow - initial support for APM2 (there are still problems) including adding ability to set Chip Select pin.
Other unrelated changes are:
a) fixed typo in 'esitmate_velocity' to 'estimate_velocity'.
b) moved init_compass from system.pde to sensors.pde which seemed consistent with other sensors.
2011-12-30 12:06:31 +09:00
Andrew Tridgell 671d0b82ad Baro: fixed MS5611 example sketch 2011-12-28 21:49:29 +11:00
Andrew Tridgell 5f0e070f4e compass: show timing in compass test 2011-12-28 21:44:18 +11:00
Andrew Tridgell c448e85ed1 Baro: show timing in baro test 2011-12-28 21:43:52 +11:00
Andrew Tridgell 669a129175 DCM: don't use compass unless its healthy 2011-12-28 20:41:54 +11:00
Andrew Tridgell 603b605eb1 I2C: fixed some warnings 2011-12-28 20:41:53 +11:00
Andrew Tridgell f4e1f3d54d desktop: exclude I2C library 2011-12-28 20:41:53 +11:00
Andrew Tridgell 9ef1c421bd MPU6k: don't init the Wire library
we don't use Wire any more
2011-12-28 20:41:53 +11:00
Andrew Tridgell 2960abf41f I2C: convert barometer library to new I2C library
this also adds a healthy attribute and error checking
2011-12-28 20:41:53 +11:00
Andrew Tridgell f93c716126 I2C: convert compass code to new I2C library
this also adds a healthy attribute, and error checking on all I2C
calls
2011-12-28 20:41:53 +11:00
Andrew Tridgell 632e74b76d I2C: imported the I2C library from Wayne Truchsess
this gives us a more robust interface, including timeouts
2011-12-28 20:28:31 +11:00
Andrew Tridgell f8e1d88815 TimerProcess: prevent a race in setting up the timer callbacks 2011-12-28 16:00:49 +11:00
Andrew Tridgell 089470a671 DataFlash: moved high level logging logic to library
this moves out all the high level logic from ArduPlane/ArduCopter to
the library. It also adds a "config page", as the last page in the
flash. This is used to check if the flash needs erasing. We only erase
now if the DF_LOGGING_FORMAT has changed.

This patch also adds a public CardInserted() method, which is used to
disable logging on APM2 if a dataflash card is not inserted
2011-12-28 16:00:48 +11:00
Andrew Tridgell 42eb62cc46 DataFlash: fixed sense of card detect 2011-12-28 16:00:48 +11:00
Andrew Tridgell 1cb8728a6b MPU6000: protect the driver from double initialisation
initialising twice can lockup the driver
2011-12-28 16:00:48 +11:00
Andrew Tridgell f2bbfb1296 MPU6000: minor fixes
the hardware functions should be private, and cs_pin should be uint8_t
2011-12-28 16:00:48 +11:00
Andrew Tridgell d35113f8a6 TimerProcess: check for duplicate registrations
if a driver gets initialised twice, make sure it doesn't get called
twice in the timer loop
2011-12-28 16:00:48 +11:00
Andrew Tridgell 0a08a0b515 TimerProcess: make some variables uint8_t
save a couple of bytes
2011-12-28 16:00:48 +11:00
Mike Smith ac3f7512cc Fix issue #423 - FastSerial flush bug. 2011-12-26 15:52:21 -08:00
Andrew Tridgell 9f5718bcfa added in DataFlash.cpp
forgot this ....
2011-12-26 19:34:06 +11:00
Andrew Tridgell 887ff43e1f desktop: added attachInterrupt() support 2011-12-26 19:17:11 +11:00
Andrew Tridgell 22c8db774f desktop: fixed for new DataFlash inheritance 2011-12-26 19:17:11 +11:00
Andrew Tridgell dd26ef3089 dataflash: reworked classes to move most code to parent class
this moves all the non-hardware specific code to the parent
DataFlash_Class class, keeping the hw specific code much smaller and
simpler.

This should prevent discrepancies creeping in between APM1 and APM2
support again
2011-12-26 19:17:11 +11:00
Andrew Tridgell 8bf05982ae dataflash: fixed APM2 flash logging
we had log wrap disabled on APM2, and also had the wrong log size. The
mainline code assumed 4096, but it is 8192 pages long.
2011-12-26 19:17:11 +11:00
Andrew Tridgell df0d151891 MPU6000: change to 98Hz low pass filter
based on recommendation from Pat
2011-12-26 19:17:11 +11:00
Andrew Tridgell 3ef707a2c3 MPU6000: use data ready interrupt to prevent stale data
We listen for a data ready interrupt and only read new data in read()
if there is new data
2011-12-26 19:17:11 +11:00
Andrew Tridgell 71e08f8484 fixed the MPU6000 test sketch 2011-12-26 19:17:11 +11:00