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

2389 Commits

Author SHA1 Message Date
Stacey Sheldon
6038bfcb40 revo servo: swap servo pins 3 and 4 definitions to match schematic
Note non-standard pin numbering on JP3 on the schematic.
2012-03-10 15:06:21 -05:00
James Cotton
820ca6a970 Initialize loop variable OUTSIDE loop so that baro is used still for altitude
hold.
2012-03-10 11:28:51 -06:00
James Cotton
f4705551b6 Update task info to cover the AltitudeHold module 2012-03-10 11:14:30 -06:00
James Cotton
690f1b5f29 Enable camera stabilization 2012-03-08 01:37:34 -06:00
Stacey Sheldon
3210bd3f9c f4 usb_dcd: disable FIFO empty IRQ while waiting for tx completion
CPU was being hammered with FIFO empty IRQs if we queued data but
the host wasn't actively draining the FIFO.

This was entirely unexpected so this hack should probably be
removed once we can figure out why this was happening.

This is almost certainly hiding some other issue.
2012-03-07 20:36:37 -05:00
Stacey Sheldon
c4bd286739 f4 usb_hid: track whether we have buffers queued on endpoints
Make sure we don't clobber our endpoint configuration by
double configuring an Rx or Tx buffer against it.  Wait for
the completion of the previous operation before allowing
endpoint configuration again.
2012-03-07 20:36:36 -05:00
Stacey Sheldon
65fc6104e6 f4 usb_hid: ignore upper layers if USB IF not yet enabled
Upper (COM) layer was calling down into the HID layer before
the HID interface had been enabled.  This was leading to
interacting with the endpoint Rx and Tx FIFOs prior to init.
The FIFO config was then being clobbered when we the USB IF
was eventually enabled.
2012-03-07 20:01:35 -05:00
Stacey Sheldon
1f37806eab f4 usb_hid: fix typo in EP IN registration call
Code was using the size of the Rx buffer instead of the Tx
buffer when registering.  Buffers are currently the same
size so wasn't causing any issues.
2012-03-07 20:01:35 -05:00
Stacey Sheldon
bc3ee6209c f4 usbhook: drop in/out bit from EP numbers before using as index
USBHOOK endpoint callback arrays should not be indexed with the
0x80 (in/out) bit set.  Oops.
2012-03-07 20:01:35 -05:00
Stacey Sheldon
6832a62872 f4 bl_helper: clear all flash errors as we unlock the flash
Error flags being set were causing flash erase operations to
fail.  Not sure why these flags were set though so this might
be hiding some other problem.
2012-03-07 19:53:18 -05:00
Stacey Sheldon
4ea1156e7b f4 bl_helper: teach bl_helper about f4 flash sector map 2012-03-07 19:53:17 -05:00
Stacey Sheldon
d1d123e4f6 revo bl: turn on USB and add support for OP DFU protocol 2012-03-07 19:53:17 -05:00
Stacey Sheldon
b8fcbad297 revo bl: remove unneeded code from revo BL
Clean up BL source tree and makefile.
2012-03-07 19:53:17 -05:00
Stacey Sheldon
c854c3f4a4 usbhook: add support in API for deactivating USB 2012-03-07 19:53:17 -05:00
Stacey Sheldon
cb9c3a9b7e usbhook: delete dead code
Remove old code left-over from porting from F1 to F4.
2012-03-07 19:53:17 -05:00
Stacey Sheldon
e2ab662b5d sysclk: pass in correct definition for HSE_VALUE
The code in RCC_GetClocksFreq() uses HSE_VALUE to determine
the tick rate of the SYSCLK.  This in turn is used by the
code in PIOS_DELAY_* to compute delays.

ST Library defaults this to 25MHz for the F4.  Our board
actually has an 8MHz oscillator so delays were way off.

Mostly affects the bootloaders since most FW code uses RTOS
delays rather than busy-waiting using PIOS_DELAY_*.
2012-03-07 19:52:54 -05:00
Stacey Sheldon
fdf54ab86c hid: fix response to HID descriptor
HID driver was incorrectly giving back the HID interface
descriptor when asked for the HID descriptor.  This should
let OP boards interact better with generic HID layer drivers
and also gives us nicer output in lsusb once the HID descriptor
is read.
2012-03-07 19:52:54 -05:00
James Cotton
61d59828dc Disable the new features if not revolution and set an error flag. Fixes
compilation errors.
2012-03-05 00:24:11 -06:00
James Cotton
7961aba83c Clean up a few more compiler warnings
Conflicts:

	flight/PiOS/Common/pios_ms5611.c
2012-03-03 13:32:56 -06:00
James Cotton
91a226fc12 Sometimes the mag stops updating so kickstart it 2012-03-03 13:31:46 -06:00
James Cotton
bc8b72623e Get rid of some unused variables 2012-03-03 11:54:09 -06:00
James Cotton
b3f620af7c Merge remote-tracking branch 'revo/stac/openocd' into revolution 2012-03-03 11:52:09 -06:00
James Cotton
f20e5da9ed Merge branch 'next' into revolution
Conflicts:
	ground/openpilotgcs/src/plugins/config/config.pro
	ground/openpilotgcs/src/plugins/config/configrevowidget.h
	ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.cpp
2012-03-03 11:41:41 -06:00
Stacey Sheldon
0684a42fac build: use board-specific JTAG interface for openocd
Removes hard-coding of JTAG interface config in the
<board>_program make macros.

This allows the use of STLINKv2 for F4 boards while
continuing to use the FOSS JTAG revB on F1 boards.
2012-03-03 08:43:01 -05:00
Stacey Sheldon
d78c5d2a9a openocd: reenable flash commands on f4 boards 2012-03-03 08:43:01 -05:00
Stacey Sheldon
c0c38609ec openocd: move to newer openocd (dec6b913)
This update fixes flash writing on F4 chips
2012-03-03 08:43:01 -05:00
James Cotton
e3df261213 Merge branch 'stac/revo-usb' into revolution
Conflicts:
	flight/Revolution/System/pios_board.c
2012-03-02 13:00:13 -06:00
James Cotton
72a93dbae5 Fix from PT for OSX/Windows F4 USB HID to send the full report size even if not
all used.
2012-03-02 11:11:36 -06:00
James Cotton
7b548eaa54 Fix bug in the integral for altitude hold where it was accumulating wrong variable. 2012-02-21 00:40:55 -06:00
James Cotton
900780e10c Add bias estimation to the altitude fusion algorithm. Necessary to increase
the gains on acceleration and velocity feedback terms (they are a problem when
biased).
2012-02-19 11:38:09 -06:00
James Cotton
47fac7e31c Move the throttle setting code for alt hold into the fast accel loop. 2012-02-18 18:16:15 -06:00
James Cotton
7d4582e5f0 Update the altitude KF to use the updated measurements appropriately and check
in the relevant matlab code to check it and genererate it.  Produces quite
smooth traces.
2012-02-16 05:33:47 -06:00
James Cotton
c957172f8f In the case of swapping in userspace due to the buffer being blocked during
ISR, make sure the latency is less than 50 us to avoid framesync errors.  Still
seeing a few nonsense packets on Overo side but fairly few.  Probably need to
add CRC to whole packet now and call it done.
2012-02-14 11:06:16 -06:00
James Cotton
1930d092eb In the case where the overo scheduler cannot swap buffers (userspace loading
it) then set a flag so as soon as the buffer is loaded then we schedule it.
2012-02-14 11:00:29 -06:00
James Cotton
f04c58b0f4 Make the overo transaction occur based on the rising edge of the NSS line.
This fixes most of the frame sync problems.  However, it's a bit hacky as
there is currently hardware information inside a module.
2012-02-14 10:37:30 -06:00
James Cotton
d018d93e88 Clean up previous commit a bit and make the sampling rate a variable (and adapt
the sampling time accordingly).
2012-02-13 01:49:54 -06:00
James Cotton
3acbfbe96c Convert the pressure sensor code to most of the calculations as int64 to retain
precision.
2012-02-13 01:22:48 -06:00
James Cotton
4717af1afd Swap telemetry port and gps ports back 2012-02-12 13:55:52 -06:00
James Cotton
f23f53dc4e Add settings for the altitude kalman filter settings and init the state when
first measurement arrives
2012-02-12 09:07:27 -06:00
James Cotton
34ca5777dd Kalman filter for altitude 2012-02-11 21:08:19 -06:00
James Cotton
d8f0494e57 Merge branch 'revolution' into revolution_overo 2012-02-11 20:02:20 -06:00
Alessio Morale
22b211167c Ported pios_iap.c to F4
restored failed boot count check on pios_board.c for revo
2012-02-11 13:49:32 +01:00
James Cotton
3026527801 Now the desired altitude is relative to when the switch was flipped so that the
baro altitude module can use a smoothed altitude estimate for the starting
point.
2012-02-08 23:02:29 -06:00
James Cotton
80d602ef7b Switch order of some commands to make sure it loads the correct hover throttle 2012-02-08 20:47:10 -06:00
James Cotton
ab41bae071 Separately smooth the error estimate from the derivative 2012-02-08 11:15:33 -06:00
James Cotton
60c951843d Use backtracking to limit integral in altitude hold and smooth the velocity
error.  Initialize the throttle integral better.
2012-02-08 10:39:31 -06:00
James Cotton
c6b1d6b8df Rework the altitude hold code a bit 2012-02-08 09:42:10 -06:00
James Cotton
49a03a868b Merge branch 'altitudehold' into revolution_overo
Conflicts:
	flight/OpenPilot/UAVObjects.inc
	flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj
	flight/Revolution/Makefile
	flight/Revolution/ins.c
2012-02-07 23:00:29 -06:00
James Cotton
6ec0f06c80 Back to 1024 byte packets 2012-02-07 13:02:11 -06:00
James Cotton
2c60447200 Switch back to 512 byte packets and fix bug when writing the header size that
was smashing the crc
2012-02-07 11:32:04 -06:00