1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00
Commit Graph

427 Commits

Author SHA1 Message Date
pip
c7ecfd2f60 Fixed pios_board.h to include the pipx .h file
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2407 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-13 19:37:01 +00:00
pip
b647d93add Added pipx board file.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2406 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-13 19:34:59 +00:00
peabody124
07798bb2db PIOS/WDG: Add back the returned delay for code that wants to clear WDG more
rarely

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2403 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-13 19:01:33 +00:00
zedamota
691c58a583 OP-268/PipX Bootloader - Changed the size of BL def.
New naming convention for the linker files:
link_(board_name)_(density)_(bl usage).ld

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2401 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-13 17:34:22 +00:00
zedamota
1f89ee1865 OP-21/Bootloader - Change HW ID to 16bits. Should still be compatible with the old version.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2398 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-13 14:36:32 +00:00
peabody124
d846288cec OP-14 I2C: Remove delay in I2C IRQ handlers
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2378 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-11 03:50:23 +00:00
peabody124
bbbd9a10e3 OP-14 I2C Diagnostics: Improve the logging so that the events going into FSM
are logged, and separately the erirq and evirq logs are exported

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2368 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-10 05:42:53 +00:00
peabody124
b173d74821 OP-237 I2C ESC support. This _will_ require you to reconfigure your
ActuatorSettings although for PWM aircrafts it should be done exactly as before

Actuator: Store the update times and maximum update time

OP-14 I2C: Start tracking short history of events and states in driver for
logging
OP-237 Flight/Actuator: Support for I2C based ESCs

OP-237 MK_ESC: Send all four motors as one atomic transfer

OP-237 Flight/Actuator: Allow channels to be mapped to MK I2C interface.  Currently
mixer channels are either PWM or MK but in the future this will change to
support more than 8 channels.

OP-16 PiOS/I2C: Further work to try and make I2C more stable, mstly special case
handline in IRQ

OP-237 I2C ESC: Support for Astect 4 channel ESCs

OP-237: When the I2C Actuator write update fails track this

OP-237 Actuator Settings: Change the way motor types are selected to keep that
information more appropriately within ActuatorSettings instead of MixerSettings

Also make motors stay at or above neutral when armed and throttle > 0

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2366 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-10 01:11:44 +00:00
peabody124
ed11e64bb2 OP-251 Watchdog: Get rid of the old extra watchdog module and instead have
tasks directly update a flag for each module (which they register) and when all
flags set clear the watchdog then.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2365 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-10 00:16:30 +00:00
vassilis
1e78cc7a30 Flight/FlightPlan: First release of flight plan scripting. The scripting engine is based on the PyMite Python VM. The released code is able to execute a simple python script on the target. However it is currently disabled from the makefile due to a few issues with more complex scripts. When the library is enabled in the makefile a python interpreter will be needed to compile the firmware since some intermediate code is generated by PyMite.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2364 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-09 22:36:15 +00:00
peabody124
5734e1f437 OP-176 PIOS/ADC: Decrease the priority of the ADC DMA/IRQ
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2360 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-09 20:49:43 +00:00
peabody124
0175e25ddf Flight/ADC: If there is a DMA error for the ADC transfer dont copy those values
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2359 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-09 20:49:39 +00:00
peabody124
148ea6fdc1 Flight: Make PWM outputs default to 0 us to avoid either pushing servos to
exteremes or running up motors

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2358 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-09 20:49:35 +00:00
peabody124
0f07d7f671 OP-240 OP-176 Flight: Setting the priority group back to 4 (anything higher
priority preempts) and adjusting the priorities around to be more sensible.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2355 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-09 20:49:26 +00:00
vassilis
407e660c97 Flight/TaskMonitor: Create TaskMonitor library, used to monitor the remaining task size of all running tasks.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2349 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-08 23:43:34 +00:00
peabody124
d8022a320d OP-238 PiOS/USB: Fix for problem Ed's being see where being plugged into usb
but not having telemetry causes a reset.  If the buffer got full enough it
would never start to transmit again.

Note: also making Telemetry non-blocking

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2346 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-08 08:05:02 +00:00
pip
cb8e9ef07b Added a moving-average-filter to the pressure reading, and increased BMP085 oversampling from 2 to 3
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2336 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-05 11:26:47 +00:00
edouard
3bad347386 Reverted a change which caused resets on the MB under certain conditions. Should be back to normal now.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2311 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-30 19:24:57 +00:00
sambas
0b2a0884ae OP-22 Flight/PiOS: Spektrum improvements, removed my zero throttle glitch
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2306 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-28 18:37:36 +00:00
peabody124
7ab6dfeeba PiOS/USB_HID: Lower priority of USB interrupt
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2280 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-24 17:16:07 +00:00
peabody124
1142b1fb1e PiOS/USB_HID: No longer clear buffer after getting a NAK. This was required
before because if transmission got NAK then sending would stop.  Now the next
time data is added to the buffer a new send will be attempted.

fifoBuf: in clearData just set the read pointer to the write pointer.  This is
safer for multiple people accessing it assuming the reader will be clearing it.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2279 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-24 17:16:04 +00:00
peabody124
ba8351f60a PiOS/USB_HID: When using FreeRTOS use a sempahore to stop multiple tasks
pushing data to the transmit buffer

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2278 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-24 17:15:59 +00:00
zedamota
14ef24a3de OP-21/Bootloader - Maximize flash space available for user code. Bring back delay on HID send (board->pc) it still hangs when blasted with data. AHRS is now Readable.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2263 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-21 17:25:24 +00:00
peabody124
f010502229 PiOS/I2C: Was throwing out repeated byte transmitted events but this is
required for longer sequences,  Need to deal with when it happens
inappropriately better.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2245 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-18 07:09:34 +00:00
peabody124
af99c31a61 PiOS/I2C: Fixed typo and also the values for I2C Diagnostics when disabled.
Enabled by default though.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2243 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-18 07:09:28 +00:00
zedamota
917f03121d Fixes a problem with the reset function introduced on the new ST libs migration, it was preventing the user space reset used with the bootloader to function properly.
I think someone still likes to honor his avatar :)

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2241 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-17 14:16:58 +00:00
peabody124
4b4a66c2d7 PiOS/I2C: Lots of small changes. Added a few weird bus events that are
sometimes thrown, and made errors not lock it up by default.  It works for me,
but since this has historically been associated with lots of lock ups please
check your systems carefully.

PiOS/I2C: Make the bus by default try to recover from errors instead of locking
up

PiOS/I2C: After a bus error and clocking all previous data create a STOP
condition to make sure bus is released (note, this also requires creating a
START condition first)

PiOS/I2C: If the same event hits the I2C bus twice in a row then disregard
second one, there is no situation where we should get the same event multiple
times that matters and this gets us out really quickly to catch the real
events.  I was seeing this with repeated 0x70084 which means byte transmitted.
This is related to STM32 bugs in the IRQ timings I believe.

PiOS/I2C: 1) Mask out some bits we don't care about in the event flags
2) Don't lock up if the give semaphore fails, although why it does is strange
3) Recover from bus failure through the "auto" state path instead of just
coding state

PiOS/I2C: Change the reset bus code to follow
http://www.analog.com/static/imported-files/application_notes/54305147357414AN686_0.pdf
(thanks for the reference Neontangerine).  Although this may actually NOT clear
the bus the first time through, subsequent bus errors should eventually clock
it out.  The up side is it is less likely to clock a bunch of 1s into an ESC
and make it run up.

PiOS/I2C: Some cleaned up code for getting a snippet of the history when
something strange happens

PiOS/I2C: Export logging information from I2C through a UAV object

PiOS/I2C: Improve the diagnostic information

PiOS/I2C: Need to handle the event 0x30084.  This seems to happen between a
byte transmitted and new byte started

PiOS/I2C: Handle the NACK condition by simply going to the stopping state.

PiOS/I2C: Add a new NACK state to handle sending the STOP signal after a NACK
following the STM documentation.  Other error conditions still are not dealt
with.

PiOS/I2C: Should handle the NACK condition from all the write cases.  Need to
think about read cases

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2239 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-17 07:01:58 +00:00
zedamota
c034a35d2c OP-21/Bootloader - Changes to the IAPObject. Implements MB and AHRS user mode IAPObject. Added user mode reset command to the CLI. To many changes to bootloading system to write here, a Wiki page will have to be writen.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2238 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-15 19:06:28 +00:00
peabody124
36ea75bc0d Flight/HID: Change how the HID code handles the transmit buffer getting empty
and starting transmission again.  This should address the bootloader locking up
on verify.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2235 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-14 01:43:16 +00:00
peabody124
1086a6b567 Flight: Changes to STM library to work with our code. Basically all the
configuration structures are const which keeps them in flash instead of ram.
However the library needs to declare them const for the compiler to work.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2231 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-13 07:03:28 +00:00
peabody124
18858571ce Flight: Updated to the latest StdPeriph libraries
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2230 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-13 07:03:24 +00:00
peabody124
e6a21977f1 OP-156 AHRS: Make the account for the fact the analog data is downsampled two
times for each EKF update

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2193 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-04 18:13:08 +00:00
peabody124
45e3ed27a7 OP-156 AHRS_ADC: Make the ADC system use a callback to better separate ADC code
from the AHRS code (which will facilitate code integration with new INS) and
also will help set up a fifo queue for the downsampled data to allow gyro data
output from AHRS faster than EKF output.  Also decreased ADC interrupt priority
so the SPI comms don't drop out.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2190 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-04 17:34:27 +00:00
pip
0cae6df8b0 Aligned fifo buffers to 32-bit for possible speed improvement.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2173 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-28 11:06:45 +00:00
pip
d4c24de556 Updated to use the new fifo_init function
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2172 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-28 11:00:20 +00:00
peabody124
cfbdad5e0d Flight/USB_HID: Change to deal with buffer filling up when GCS not ACK'ing the
usb transmissions.  Clear TX buffer after any NAK.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2147 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-23 19:29:10 +00:00
peabody124
e89911bb8a OP-203 PIOS_USART: Don't disable interrupts for receive buffer since
only one receive task.  This is less generally safe but decreases the
frequency of resets in our current configuration

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2144 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-23 17:13:49 +00:00
peabody124
a454f06bf8 OP-203 PIOS_UART: Tweaked the way the interrupts are reenabled to get comms
stable again

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2143 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-23 17:13:48 +00:00
peabody124
300a3bc8ad OP-203 PIOS_USART: Get TX buffer using fifo_buffer
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2142 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-23 17:13:46 +00:00
peabody124
e3dd542609 OP-203 PIOS_USART: Make USART Rx code use fifo_buffer
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2141 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-23 17:13:44 +00:00
zedamota
d57441e8f4 OP-21/Bootloader - forgot to commit this too..sorry (check last commit)
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2137 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-21 22:58:14 +00:00
zedamota
98b0f406dc OP-21/Bootloader - fixes GPS connected issues, enhances timings problems, further work on serial support
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2136 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-21 19:37:40 +00:00
osnwt
ed49f7fc40 Prevent some compiler warnings treated as errors during RELEASE build (possible use of uninitialized variables - CodeSourcery under Windows build system). It may be done with some #pragma as well, but this way is more portable.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2132 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-21 13:09:05 +00:00
sambas
c74c9cc08e OP-73 Flight/PiOS: deinits started, still just for review
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2107 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-11 20:38:44 +00:00
sambas
f94dc41712 OP-73 Flight/PiOS: runtime RC input change, initial files just for review, not integrated to build yet
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2106 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-11 19:09:39 +00:00
peabody124
42a02e5662 Flight/HID: USB priority to 8 instead of 1. Probably Need to make the HID layer use a
similar driver format to the PIOS_USART system.  (p.s. are you happy now, PT?)

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2029 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-28 15:07:07 +00:00
peabody124
b9f74a86c3 OP-198 Flight/Libraries: Swap to using circular buffer code from Pip because it
supports thread safe write/read simultaneously

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2027 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-28 14:30:03 +00:00
peabody124
0bdaf4d0df OP-197 Flight/USB: Make non-blocking send return -2 instead of -1 for not enough space
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2026 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-28 14:30:00 +00:00
peabody124
acc6df4c2d Flight/USB_HID: Make the userspace command wait until not in interrupt before
running and block the interrupts while modifying the buffers

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2003 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-24 01:35:30 +00:00
peabody124
cd04845c3d Flight/HID: NAK instead of stall USB bus (former was mistake) and change
polling time to 4 ms

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1996 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-20 05:21:25 +00:00
dankers
4ed3359f6f Comment was misleading.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1992 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-19 17:25:07 +00:00
kokomojoe
2fe266650f OP-185 Flight - support files for Firmware IAP object
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1891 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-06 02:06:13 +00:00
kokomojoe
20c6e2292a OP-185 Flight helper functions for the firmware IAP object. Allows setting/clearing of back-up registers
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1890 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-06 02:02:37 +00:00
peabody124
ea3fb03c7f Flight/AHRS Communications: Switch to Les' very nice UAVObject communication
scheme

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1835 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-02 02:17:18 +00:00
les
498f3d0fa6 PIOS SPI: Added a function to detect if the channel is busy
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1829 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-01 16:52:20 +00:00
sambas
2d90a80e22 Flight/PiOS: this patch makes dosfs work with both MBR and VBR formats. Backup your SD files in case this messes something!! Testing needed.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1798 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-29 16:29:38 +00:00
kokomojoe
6f1f990d85 OP-21 AHRS/Bootloader - Moved start of user code to 0x08002000. Must be used with latest AHRS Bootloader compiled with DEBUG=OFF.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1788 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-28 02:21:48 +00:00
peabody124
3c021c09d9 Flight/PiOS: Whitespace changes
find ./flight/PiOS/inc/ \! \( -name '*~' -a -prune \) -type f    | xargs -I{}
bash -c 'echo {}; dos2unix {}; gnuindent -npro -kr -i8 -ts8 -sob -ss -ncs -cp1
-il0 -hnl -l150 {};'

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1777 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-27 07:28:45 +00:00
peabody124
77b68e5169 Flight/Guidance: Initial template for guidance module
Flight: Create PositionDesired (the active waypoint) UAVObject and make the FlightSituationActual no update since it not used.
Flight: New velocity desired object that passes information between the look computing the desired velocity and the PID loop to get it (updated at different rates)
UAVObjects/PositionActual: Remove unused GPS fields
UAVObjects/PositionActual VelocityActual: Split the velocity into a separate object.  ALso make sure all the information telemetered around is in cm to avoid using floats.
UAVObject/GuidanceSettings: New guidance settings object for the guidance module
Flight/Posix: Add the new objects to the Posix sim
Flight/Guidance: Computes a desired velocity based on position error than runs a PID loop to control roll and pitch to achieve that velocity.  All distances are in cm, and updated the PositionActual fields to reflect this and use int32.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1760 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-26 03:06:27 +00:00
peabody124
a01783b2a8 OP-140 AHRS: Explicilty deal with if it is initialized or not, use that to
determine retransmitting calibration, home location and such.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1755 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-25 21:05:38 +00:00
peabody124
9b28f2d72c OP-167 OP-157 AHRS/Calibration: Added mag scale and really cleaned up calibration.
Calibration should take less time now too (using second moments to estimate
variance in one pass).  Now need to change to multiple messages to get the
calibration in to keep the request message size minimal.  Also currently
running sensor calibrate doesn't store the gyro bias so if you want to use this
you'll have to tweak it manually.  I'll fix that step tomorrow.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1741 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-25 09:20:38 +00:00
sambas
24840b461d OP-22 Flight/PiOS: added failsafe and recovery "watchdog" timer
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1697 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-20 18:00:31 +00:00
zedamota
87dc0908ce OP-21/Flight Bootloader - Bug fix
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1695 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-20 16:29:34 +00:00
zedamota
3ba6372dc4 OP-21/Flight Bootloader - Clean up and linker files for the AHRS
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1691 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-19 18:27:53 +00:00
zedamota
c9752a6a3a OP-21/Flight Bootloader - some changes for the bootloader to work
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1682 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-18 23:11:42 +00:00
peabody124
8e0c5136c0 AHRS/Comms: Make the polling delay 1ms instead of 20ms to make sure if a message isn't ready we don't pause for a long time.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1673 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-17 18:12:25 +00:00
peabody124
a6ca5b82e7 OP-155 Flight/HID: Make the HID stall when buffer full. Not sure the consequences on ground (i.e. if it handles the stall correctly)
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1665 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 20:23:02 +00:00
zedamota
e8d6e7c557 Flight - Centralized board specific files, BL and User FW uses the same board definitions, no need to have 2.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1663 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 19:19:38 +00:00
peabody124
110c46216e OP-155 Flight: Increase the pios_com buffer size to support these larger objects. If this gets worse and we don't want to use as much OP memory we can make it stall the USB bus when the buffer is full.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1657 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 05:57:03 +00:00
peabody124
885c966e53 AHRS: Added a tracker for number of ADC updates the EKF misses. Also updated the Telemetry autogenerated files to accomodate the 11500 baud rate.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1652 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 02:59:00 +00:00
peabody124
19e80da928 AHRS: Update UAVObject with information about AHRS rate
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1650 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 01:54:21 +00:00
zedamota
3e89e388fa OP-21/Flight Bootloader
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1643 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:09:27 +00:00
zedamota
c72a5b1cfe OP-21/Flight Bootloader
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1642 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:08:24 +00:00
zedamota
f972b78bfb OP-21/Flight Bootloader
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1641 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:07:43 +00:00
pip
89fb0b8582 Made pios_hmc5843_data_ready volatile (accessed by both interrupts and main exec loop).
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1638 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:00:36 +00:00
stac
55d90970ed hmc5843: hide internal #defines and functions
Way too much was being exposed in the API for the
HMC5843.  This commit properly hides internal
details of the driver.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1629 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:04 +00:00
stac
0e7a801e9e hmc5843: Add support for DRDY signal from magnetometer
The DRDY signal from the magnetometer is connected to PB8
on the STM32.  This pin is now configured as an external
interrupt and is now used to signal when new data is
available from the magnetometer.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1628 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:02 +00:00
stac
4ac001553d hmc5843: convert line endings from CRLF to LF
No functional changes.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1627 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:00 +00:00
stac
88e73906d0 i2c: Add recovery code for i2c bus errors
I2C bus errors are now recoverable.  The bus is properly reset
and an error indication is now provided to the caller whenever
a bus error occurs during processing of the transaction list.

For now, the users of the I2C layer just retry infinitely on
failure.  The BMP085 and HMC5843 code should be changed to
report errors to its callers to allow a more sensible retry
strategy.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1625 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:57 +00:00
stac
0122394481 i2c: consolidate handling of AUTO transitions
AUTO transitions in the FSM are now handled immediately
after processing each newly injected event rather than only
at the end of the EV ISR.

This consolidation allows the upcoming addition of event
injection from both the EV and ER ISR contexts.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1624 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:56 +00:00
stac
7d5463e5e6 i2c: Move polling for bus stopped from ISR to task/mainloop
Occasionally, the I2C driver races with the STM32 I2C peripheral
at the end of a bus cycle.  This leaves the bus in an errored
state and the stop condition is not properly asserted on the bus.

The polling for the stopped condition was previously implemented
in ISR context since it was expected to be nearly instananeous.
In the error condition, however, the stop condition will never
happen.  The polling for this case is now done by the initiating
task (or mainloop on the AHRS) to prevent the timeout condition
from triggering the watchdog.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1623 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:55 +00:00
stac
65ad2caf8a i2c: Make transaction initiator available in txn list
The info field in the pios_i2c_txn list can now be used
to provide a const string which describes the context
for this transaction.

This is very helpful when diagnosing an error that occurs
somewhere in the middle of the I2C FSM since the FSM runs
primarily in the ISR where the original context for the
transactions is no longer available in the traceback.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1622 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:53 +00:00
stac
85c60479c1 i2c: rename FSM faulted state
Differentiate the _FSM_ faulted from the (soon to
exist _BUS_ faulted state.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1621 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:52 +00:00
pip
cc3860daaf Added 'uint32_t PIOS_SYS_getCPUFlashSize(void)' into pios_sys.c/h files.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1616 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-14 09:18:55 +00:00
pip
8bfaa997d3 made curr_state 'volatile' in pios_i2c_priv.h to prevernt compiler optimization lockup.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1611 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-13 20:52:56 +00:00
zedamota
66560786f4 Flight - #ifdefs to make it work with both normal and bootloader packet formats.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1609 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-13 17:08:52 +00:00
zedamota
257b4d2c95 flight - BL AHRS Comms - fixes to make it compile, not tested yet.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1601 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 21:08:43 +00:00
pip
d0b8a9755d Added USB_LED_ON/USB_LED_OFF and checks to see if they are defined to the PIOS_USB_HID_ChangeConnectionState function ..
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1596 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 10:47:20 +00:00
pip
9fca16db41 Added an RTOS detection is 2 places because I'm using this file on the modem (without an RTOS). #if defined(PIOS_INCLUDE_FREERTOS) ...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1595 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 10:33:45 +00:00
stac
d18e0c3ef8 ahrscomms: Add low-level message code for bootloader msgs
Implement low-level utility functions for sending/receiving
the opahrs proto v0 (bootloader) messages.  These are used
by the OP firmware loader and the AHRS bootloader.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1586 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-11 23:06:31 +00:00
stac
c3c8a30bfc ahrscomms: fix return values on error
Some functions were returning -1 instead of one of the
valud enum values.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1585 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-11 23:06:29 +00:00
stac
6bf3038f3f ahrscomms: provide helper function for simple requests
This cleans up some of the boiler plate code that is
repeasted for simple (empty) requests that expect a
response.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1584 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-11 23:06:28 +00:00
stac
7ecbb5f5b8 opahrs_proto: Add new boot and versions messages
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1583 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-11 23:06:26 +00:00
stac
d1dc300081 ahrscomms: remove unused sync and switch_proto messages
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1582 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-11 23:06:25 +00:00
zedamota
aa1af2b9f3 OP-21/Flight Bootloader - Changes to make it independent of RTOS
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1570 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-09 18:44:55 +00:00
peabody124
b853c392f3 Flight: Was only returning half of the serial number (thanks for catching that Pip)
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1476 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-31 02:33:47 +00:00
pip
7813414f29 added casting to prevent int overflows when calculating the watchdog delay
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1467 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-30 16:48:33 +00:00
pip
ba5f1b37ee changed pios watchdog from 8-bit to 16-bit ms capability, plus moved the .h file from the .c folder into the inc folder
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1466 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-30 16:29:36 +00:00
peabody124
f202884ce8 AHRS: Numerous changes. Added CPU load monitoring for AHRS as well as some friendly debugging output options. Also added a new CalibrationMode setting to AHRS (Echo) to speed up sensor calibration. Cleaned up the 6 point calibration interface to make it more friendly, but I think Edouard will clobber it with something nice and sexy :).
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1455 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-29 06:38:30 +00:00
stac
a19c225697 ahrscomms: reduce retries and retry delay
The number of retries and delay between retries was
increased in a previous commit.  This doesn't appear
to be necessary so I'm reverting the increases.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1432 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-27 02:15:02 +00:00
stac
47df1faa8d ahrs: whitespace adjustments
No functional changes.  Whitespace/tab fixups only.
Use TRUE/FALSE instead of 1/0.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1430 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-27 02:14:58 +00:00
stac
0a7088c24a ahrs: fix type on flags, remove redundant code
No need to have boolean flags being floats.
Some of the attitude message was being populated twice.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1428 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-27 02:14:54 +00:00
peabody124
8dd81443be OP-122 Flight: Same changes regarding 62 byte limit applied to the receiving code on the device.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1405 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-25 05:32:56 +00:00
peabody124
dd491160c5 OP-121 OP-122 Flight: Improved the Blocking/Nonblocking behavior for USB to be correct. I'd like a mutex still around the transmission buffer but don't want to slow down the interrupt.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1404 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-25 05:32:54 +00:00
peabody124
4ca10e92c7 OP-121 OP-122 Flight: Improved USB HID communication.
1. Added reenumeration function and call it on USB init (device will appear after reprogramming now)
  2. Moved buffer.c to general flight/Libraries location
  3. Removed the 62 byte transmission limitation by adding a transmission buffer
  4. Sped up USB communication by increasing endpoint polling frequency

Note, that the nonblocking and blocking USB send functions are not blocking entirely correcting.  The blocking calls the nonblocking, and the nonblocking blocks until the last chunk has started tranmission if it's a big transmission.  The buffering I added would generalize to non-blocking nicely, but would require using the EP1(IN) callback to handle most of the tranmission.  This creates a lot of issues if one function is pushing data onto the buffer and the interrupt is sending.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1403 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-25 05:32:52 +00:00
peabody124
bd8fffe4d0 AHRS/Flight: Renamed AttitudeSettings to AhrsSettings to make it more intuitive. Added the ability to change the algorithm from GCS.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1383 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-23 03:39:13 +00:00
peabody124
2596f43511 OP-120 AHRS: Moved conversion of quaternion to RPY over from AHRS to OP to minimize transfer and computational load on AHRS.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1381 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-23 02:35:39 +00:00
zedamota
b0d1d0dd09 OP-21/Flight Prep work for the USB HID bootloader
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1373 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-22 18:54:57 +00:00
peabody124
5662d85c4e OP-120 AHRS: Tightened up the communication protocol so it runs more quickly. Looks ok in gdb but GCS not crashing right now (rendering error) so I can't test it properly.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1366 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-22 00:21:54 +00:00
peabody124
8897c441fa OP-118 AHRS: Added AHRSCalibration object and messages associated with that to AHRS. Also made AHRS run calibration only when requested. We will create a GCS plugin that runs through computing the calibration settings. To compute the variances on the AHRS set the measure variances to true, wait ten seconds, then set it to false to read it back.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1363 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-21 21:46:02 +00:00
stac
26e257d340 spi: slow down OP <-> AHRS spi link
Issues have been reported with CRC errors
on the SPI link between the OP and AHRS
boards.  Slowing the link down eliminates
the errors in my testing.

If we speed this link back up in the future,
further investigation will be required to
diagnose the source of the CRC errors.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1356 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-21 16:19:20 +00:00
stac
f388deef34 hmc5843: standardize line endings
This file had mixed line endings.  Now they're all the same.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1353 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-21 16:19:14 +00:00
stac
7b2111e512 baroaltitude: rename AltitudeActual to BaroAltitude
This is to align the object names to matches the UAVObject
architecture doc.  No functional changes.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1351 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-21 16:19:10 +00:00
stac
47c36b3da0 i2c: fix error in FSM for restarted reads
The transition from the ADDR state to the read state
was broken for non-final reads.  The FSM diagram was
also wrong for this transition.

Since reads are always the last transaction in a sequence
in our current usage, this doesn't actually fix any known
bugs.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1350 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-21 16:19:06 +00:00
stac
98822bff98 i2c: force bus free on warm starts
Since the i2c bus is bidirectional, there are certain
states (eg. part way through a read) where the slave
device is in control of driving the SDA line.

On a cold start (power on), the slave devices are all
quiescent and will not drive the bus.  However, on a warm
start (eg. watchdog or jtag restart), it is possible that as
the CPU boots, the slave device may be holding the SDA line
low.  This is a bus busy condition and will prevent the I2C
bus master in the CPU from being able to seize the bus during
init.

The fix for this is to clock the i2c bus sufficiently to ensure
that the the slave device finishes its transaction and releases
the bus.

Once the slave has released the bus, the bus master can properly
initialize and assert a STOP condition on the bus.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1349 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-21 16:19:02 +00:00
peabody124
2031cfe4d0 OP-119 AHRS: Added error counters for the messages as well as changed an error on AHRS echo back for the HomeLocation message.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1344 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-20 22:52:13 +00:00
peabody124
ef0b307353 [OP-119] Flight/AHRS: Created a HomeLocation object which is updated when the GPS gets an initial 3D fix and populated with the information to convert from LLA from the GPS to NED reference frame. Also added a message for passing the MagneticNorth vector to the AHRS and removed that computation from AHRS.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1337 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-19 20:38:27 +00:00
peabody124
3c4def13cc AHRS: Added message to pass GPS information into AHRS from OP. This is then converted
into NED reference frame and used in the INSGPS algorithm, although currently this
information isn't propagated back to OP.  Data structures related to the GPS position
into the algorithm and the position estimate out will likely be in flux.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1334 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-19 05:18:34 +00:00
peabody124
cfd20922cd AHRS: Added the filtered data to the attitude raw object. Even though this seems like an oxymoron it's still raw to the EKF algorithm, and nice to see the real values after filtering to make sure nothing weird is going on. However, if people don't like this I'm open to suggestions/patches. I'd maybe suggest the whole attituderaw object be converted to ahrsraw anyway since it's more like that (eg. none of the values are actually attitude estimates).
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1325 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-18 14:54:24 +00:00
peabody124
450cf07a89 AHRS: Keeping magnetometer I2C address consistent with change to I2C driver.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1323 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-18 13:54:15 +00:00
FredericG
b46bc68e96 "addr" field of I2C transaction struct now takes real I2C address, and not address that is pre-shifted to accommodate the R/W bit
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1321 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-18 10:04:55 +00:00
stac
3125ecfc4e AHRSComms: altitude sensor data is now sent to AHRS
Altitude/pressure sensor data is sent to the AHRS whenever
the AltitudeActual object is updated.

Altitude, Pressure and Temperature are sent as floats.
Same as in the UAVObject that goes to the GCS.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1291 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-15 01:02:13 +00:00
stac
c3e509c2cb attituderaw: Replace HeadingActual with AttitudeRaw
AttitudeRaw now includes:
 - magnetometers XYZ (in mG)
 - gyros XYZ (raw ADC samples)
 - accelerometers XYZ (raw ADC samples)
 - placeholder for gyro temp sensors (read as zero for now)

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1289 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-14 23:42:14 +00:00
peabody124
a084d21804 Merge branch 'watchdog'
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1281 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-13 05:18:17 +00:00
stac
f74c6ffdd5 i2c: rewrite i2c layer
The STM32 I2C block has a number of errata associated with it.
These errata are primarily related to timing sensitivities between
the peripheral and the interrupt handler.  In particular, the
correct generation of the stop bit relies on the I2C IRQ running
immediately and not being held off for any reason.

NOTE: The I2C interrupts must be the highest priority IRQs in the
      system to ensure correct operation.

I2C protocol is now implemented as a formal state machine.
See: stm32_i2c_fsm.{dot,jpg} for FSM description.

I2C init is now expressed by const initializers in pios_board.c
for both OP and AHRS boards.

I2C device drivers (ie. bmp085/hmc5843) now pass in const arrays
of an unlimited number of bus transfers to be done atomically.
The I2C adapter driver now handles all bus-level locking across the
list of transactions.  Generation of start/restart/stop conditions
are handled automatically over the list of transactions.

Timeouts have been removed from the API for now.  May be added
back later.

This driver has run error free on both the OP and AHRS boards for
up to 48hrs but it still sometimes fails earlier than that on the OP
board.  There is another possible set of improvements to the driver
that could employ the DMA engine for transfers of >= 2bytes.  This
change would reduce the timing sensitivities between the peripheral
and the driver but unfortunately, both the SPI and I2C interfaces
share the DMA1 engine.  That means only one of these two peripherals
can use the DMA engine and right now, SPI between OP and AHRS is
already using it.

Failures are currently fatal and will lock up the CPU.  This allows
useful information to be obtained in the failure cases.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1241 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-08 04:15:08 +00:00
stac
b6c1f43145 i2c: Change API to allow passing const config data
Mark the I2C_InitStruct parameter as const so that we can pass
const data as the initializer.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1240 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-08 04:14:58 +00:00
peabody124
0fdfbb2ffb Deleting old USB code that I meant to delete a while ago. Also changed names of some functions to OP. Finally fixed the USB taking over PIOS telemetry. Detects the USB cable and that the configuration has been taken by the USB bus.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1217 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-05 23:43:52 +00:00
pip
0331f05e9a Added extra LED's .. now up to 4 LED's .. (PipBee has 4 controllable LED's)
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1207 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-04 17:32:42 +00:00
sambas
7f6336d324 OP-22 Flight/PiOS: Spektrum reworked, input is mapped to old aux in receiver connector, works nicely with calibration plugin. Also bind works, just needs config flag to bind on powerup
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1189 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-01 10:34:07 +00:00
peabody124
7e6afe5a75 Updated HID code to do packet processing in OS indepdent layer. Should now work on all platforms. Please test and get back to me. Maximum object size of 62 bytes currently.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1174 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-28 18:55:04 +00:00
peabody124
6f63c10dca Removing more debugging comments
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1168 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-27 23:48:12 +00:00
peabody124
3144e3157c Added back checks on USB cable so falls back to serial telemetry if not plugged in
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1167 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-27 23:11:28 +00:00
peabody124
27bcd20882 HID working on Mac for telemetry. Need to tweak GCS code for Win/Linux
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1166 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-27 20:50:20 +00:00
peabody124
dac82b3c17 Getting closer for HID. Now a well behaved HID device. Just need to update GCS plugin for new data format and make PJRC wrappre work properly on Mac
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1165 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-27 19:09:55 +00:00
peabody124
27d429fe18 Got better HID report design with valid data length embedded in report
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1164 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-27 17:41:56 +00:00
FredericG
66e22b56ce Fix in bmp085 driver. Was not checking correctly if lock on I2C succeeded => caused an assert when used in combination with other I2C devices
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1163 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-27 09:52:45 +00:00
peabody124
fe616df48d Further tweaks. Will start trying to get reliable communication with larger report size tomorrow
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1159 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-27 07:56:50 +00:00
peabody124
840f7ff456 A version of the firmware that successfully Acks back and forth over HID. Still need to refine the PIOS interface and make GCS strip out the report ID data (if necessary). Also note: currently if you run too many modules the watchdog timer kicks in. I haven't determined if this is due to an interrupt binding up or what (and why it doesn't happen more often since I can't find any code that explicitly resets the WWDG).
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1157 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-27 06:22:34 +00:00
peabody124
d89cd43cd1 Further tweaks to the HID update
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1156 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-27 05:28:04 +00:00
peabody124
c46dcea73a Pretty major update of the USB HID core. Removed a lot of old code related to custom drivers and BSL (which will be brought back under HID). Device enumerates but still not communicating. Hopefully nothing broken, lots changed.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1155 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-27 03:19:07 +00:00
peabody124
d928676f5e More documentation updates, standardizing format to include addtogroup at the beginning of headers so files are associated with modules
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1121 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-16 19:53:35 +00:00
peabody124
99e94228a9 More doxygen updates
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1106 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-16 05:31:11 +00:00
vassilis
9f2a01a78a Flight/Servo Fix Servo driver buffer overflow, was messing up the I2C and altitude readings, now working fine. Servo index used to be 1-8 but the Servo driver was indexing a buffer out of bounds. Changed everything to use index 0-7 for servo outputs.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1061 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-11 01:54:43 +00:00
stac
17bea4cb91 ahrscomms: connect the OP board to the AHRS board
The AHRS comms module now sync's with the AHRS and
exchanges interesting data periodically.  Whenever
the link to the AHRS is down, the AHRSComms alarm is
raised.

This is fairly basic for now but provides the last
piece of the infrastructure to move data back/forth
between the OP and the AHRS.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1014 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-04 02:21:49 +00:00
stac
29a8f05ac9 mag sensor: put some bounds on the parameters
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1012 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-04 02:21:45 +00:00
stac
a3a2dbd634 spi: Add support for hardware CRC generation/checking
PIOS SPI devices may now make use of automatic CRC generation
and checking on block transfers.  Only supports CRC8 for now.

Since the SPI interface CRC calculation continues across message
boundaries (ie. not reset on every transfer), we must manually reset
the CRC registers for every transfer to allow the two sides of the
link to resynchronize.

Unfortunately, resetting the CRC registers requires disabling the
SPI peripheral which must now be done on every block transfer.

Note: The last byte of the tx buffer is never sent and is assumed to
      be a place holder for the tx CRC8.
Note: The last byte of the rx buffer is expected to hold the rx CRC8.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1011 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-04 02:21:42 +00:00
stac
c12b7e3fed spi: tx buffer is now const
Tx buffers should not be modified.  This allows passing const data
to the transfer function.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1010 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-04 02:21:40 +00:00
stac
89a6d6d912 ahrs spi: Add definition of OP<->AHRS SPI protocol
This defines the SPI message format as well as a few
initial messages for moving data across the link.

The v0 messages are place holders for firmware download
in the bootloader.

The v1 messages are to be used by the main application.

Note: This is not the final protocol definition.
      Subject to change without notice.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1004 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-04 02:21:15 +00:00
stac
71e491e3c1 com: mark tx buffer as const throughout API
The com layer transmit functions should provide guarantees
that they will not modify the buffer that you're transmitting.
Declaring the parameter as a pointer to const keeps the underlying
implementations honest.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1001 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-04 02:21:08 +00:00
stac
4f8d81343f spi: assert on invalid SPI device
TransferByte API is simplified to either assert or
return the rx byte.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@999 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-07-04 02:21:00 +00:00