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

1910 Commits

Author SHA1 Message Date
Stacey Sheldon
60969b57d8 usb-hid: split apart hwsettings for HID and VCP ports
This allows the HID and VCP functions to be configured
separately so that additional functions can be more easily
bound to the VCP port.

This change also provides a safety net that forces either
the HID or VCP to be configured for USB Telemetry.  This
safety net may vanish in the future once the GCS can check
it.  Disabling USB Telemetry entirely would save more than
400 bytes of RAM.
2011-12-30 23:05:37 -05:00
Stacey Sheldon
ab135aa00b com-bridge: Make com-bridge an optional (and configurable) module 2011-12-30 23:05:36 -05:00
Stacey Sheldon
5b3227d1ff com: reduce buffer sizes for com layer
This saves a few hundred bytes of RAM in a typical
configuration.
2011-12-30 23:05:36 -05:00
Stacey Sheldon
785a7ccd88 uavtalk: convert tx to use blocking send routines
The uavtalk layer was previously implementing a poor
version of packet fragmentation based on a hard-coded
max packet size.  Since this was hard-coded, there was
no guarantee that it would match the underlying devices.

Now that the COM layer sending routines support fragmentation,
remove fragmentation and use the COM layer directly.

This will support future buffer size reductions in the COM
layer.
2011-12-30 23:05:36 -05:00
Stacey Sheldon
16619584e4 usb cdc: return valid data in response to SetLineCoding 2011-12-30 23:05:36 -05:00
Stacey Sheldon
a68f5a4fc9 com-bridge: detect lost characters on transmit 2011-12-30 23:05:36 -05:00
Stacey Sheldon
80e0be3cec com: fragment transmitted buffers to match underlying device
PIOS_COM_SendBufferNonBlocking() will now fragment its buffer
to match the max size of the underlying device.

This allows the buffer size of the underlying device to shrink
below the maximum message size, thus allowing us to use smaller
buffers on memory-constrained platforms.
2011-12-30 23:05:36 -05:00
Stacey Sheldon
407bec0c95 usb cdc: track oversized rx buffers 2011-12-30 23:05:35 -05:00
Stacey Sheldon
b858cf387e com: track dropped bytes on rx for usart and usb com 2011-12-30 23:05:35 -05:00
Stacey Sheldon
2040645171 com: Use all bytes in Tx buffer
Code would previously fail Tx if we happen to send data
that happened to be exactly the size of the available space
in the tx buffer.
2011-12-30 23:05:35 -05:00
Stacey Sheldon
34af9ac92d usb_com: NAK rather than STALL on buffer full
STALL should only be used to indicate an error has occurred.
NAK is the correct mechanism to provide backpressure.
2011-12-30 23:05:35 -05:00
Stacey Sheldon
e2bb7140fe usb cdc: allow use of entire rx buffer
Previously, the code only allowed n-1 bytes of the
available space to be used.
2011-12-30 23:05:35 -05:00
Stacey Sheldon
86aead52ce usb cdc: only pass valid bytes from USB rx up to com layer
Previously, up to 63 random bytes would be passed to the COM
layer and would be delivered to the application as though
the far end had sent them.
2011-12-30 23:05:35 -05:00
Stacey Sheldon
f54c0552ce com: make sure we know when a higher prio task is woken 2011-12-30 23:05:34 -05:00
Stacey Sheldon
202b1bd428 com: Always kick rx_start if we got zero bytes
This will ensure that we kick rx_start at least once every
time that a user tries to receive bytes from the underlying
device.
2011-12-30 23:05:34 -05:00
Stacey Sheldon
64f498e48a com-bridge: add usart to usb vcp bridge 2011-12-30 23:05:34 -05:00
Stacey Sheldon
504cf3417f init: collapse usart definitions for generic usage
Telemetry and GPS usarts are generic users of the uart
devices.  This collapses the duplicated usart configuration
structs into a single generic one.
2011-12-30 23:05:34 -05:00
Stacey Sheldon
eebdda6276 usb cdc: make HID/CDC configurable in hwsettings 2011-12-30 23:05:34 -05:00
Stacey Sheldon
e6ead85857 usb cdc: fix device descriptor to work on Mac
Apple is very particular about requiring the bDeviceClass
to be set to 2 (Commmunication Device) even for composite
devices which seems wrong.

Device is enumerated without error on Mac now.  Not sure if it
works though.
2011-12-30 23:05:34 -05:00
Stacey Sheldon
617a30c07c usb cdc: attach telemetry to CDC rather than HID 2011-12-30 23:05:34 -05:00
Stacey Sheldon
59cb489e01 usb: clean up pios hooks into stm32 usb_core
Reduced scope of many variables since they were being
exposed unnecessarily.

Renamed pios_usb_hid_prop code to pios_usbhook to reflect
the fact that it implements all of the callout functions
that are hooked into the stm32 usb library.
2011-12-30 23:05:33 -05:00
Stacey Sheldon
c0259dc616 usb cdc: USB composite device with HID + VCP 2011-12-30 23:05:33 -05:00
James Cotton
0b00e748a9 OP-565: Added the ability to do a trim flight to compute the accels for level flight 2011-12-21 15:25:00 -06:00
Oleg Semyonov
10287e3e29 CC: rename ReceiverPort PPM+Servo (Servo) options to PPM+Outputs (Outputs) 2011-12-11 22:52:51 +02:00
James Cotton
162b0d7f75 Because the UAVO field sorting required for revo changes all the object IDs,
trigger a flash wipe on all existing boards with this upgrade.
2011-12-10 14:13:28 -06:00
Corvus Corax
a0cd71abe6 UAVObjects ; Modules/ManualControl: Fixed metadata interface and segfault when retrieving it 2011-11-30 09:20:46 +01:00
Oleg Semyonov
1f60f80053 Bring back the ERASE_FLASH option support for SettingsEraseFirmware 2011-11-26 22:57:33 +02:00
James Cotton
fae611a01f Fix bug where clicking back at last screen of input wizard would go back to
main screen and then in future buttons hung around for no reason
2011-11-25 11:30:12 -06:00
Oleg Semyonov
6d78b97d92 dsm: update DSM protocol binding details in the comments (no code change) 2011-11-19 17:33:04 +02:00
James Cotton
aa698f7b0a Increase the CC IRQ stack to avoid some memory warnings 2011-11-16 09:20:30 -06:00
Oleg Semyonov
4a99ec3298 code style: move variable into function and free 1 byte of RAM :-)
component     free heap used
    ----------------------------
    Nothing            2560    -
    PWM                2432  128
    PPM                2408  152
    DSM                2464   96
    S.Bus              2448  112
    GPS (port only)    2368  192
    GPS (port+module)  1312 1248
    CameraStab         2096  464
    Telemetry          1928  632
2011-11-13 18:27:52 +02:00
James Cotton
b110e9c549 Style suggestions to cleanup GPS from Stac 2011-11-12 21:31:01 -06:00
James Cotton
f0b22519be Merge remote-tracking branch 'origin/corvuscorax/CC_GPS' into next 2011-11-12 21:30:53 -06:00
James Cotton
fdcc6c2d41 Fix a bug I made in programming the bootloaders via jtag 2011-11-12 21:29:46 -06:00
Corvus Corax
198c819943 some more makefile cleanup 2011-11-11 11:54:31 +01:00
Corvus Corax
cd473ed1fd some makefile cleanup 2011-11-11 11:51:45 +01:00
Corvus Corax
aa69027cb2 Merge branch 'next' into CC_GPS 2011-11-11 11:44:11 +01:00
Corvus Corax
61ecc0d310 make optional modules check themselves if they should start or not 2011-11-11 11:39:57 +01:00
Corvus Corax
e03e3c2ed8 removed "special code" to start optional modules 2011-11-11 11:22:54 +01:00
Corvus Corax
5e14e69a08 Revert "OpenPilot: Initialize optional modules based on UAVObject"
This reverts commit 9f03ba178b.
2011-11-11 11:08:49 +01:00
Corvus Corax
9679638244 Revert "Modules/GPS: removed comment line"
This reverts commit 109a58ef30.
2011-11-11 11:07:02 +01:00
Corvus Corax
88f161dd42 Revert "Makefiles: fixed comment line"
This reverts commit 0065842de7.
2011-11-11 11:06:32 +01:00
Oleg Semyonov
8f77d07119 System Module: fix stupid out of memory detection bug 2011-11-07 19:14:55 +02:00
Oleg Semyonov
f5e82b8242 spektrum: rename Spektrum to DSM (DSM2/DSMJ/DSMX used by Spektrum and JR radios)
No code changes, just file, variable and define names are changed.

First, it better describes the serial protocol used by DSMx satellite
receivers. Second, many people using Spektrum radio, assume Spektrum
protocol. This is the attempt to address those inaccuracies.
2011-11-04 21:40:34 +02:00
Oleg Semyonov
8ed23c76b7 spektrum: fix OpenPilot MB target (deprecated) after spektrum changes 2011-11-04 20:43:49 +02:00
Oleg Semyonov
481bff2578 spektrum: code style fixes accoring to OPReview-122 2011-11-01 18:48:07 +02:00
Oleg Semyonov
a8b36ddd28 HwSettings: disable GPS and telemetry port speed updates at run-time
This is to be consistent across the HwSettings object fields which are
read on boot only by convention.
2011-10-31 23:04:17 +02:00
Oleg Semyonov
0116e6a007 spektrum: rework DSM2/DSMJ/DSMX driver for explicit DSMX resolution support
- both CC serial ports are now disabled by default (no telemetry);
- serial ports now have DSM2, DSMX (10bit) and DSMX (11bit) options;
- ReceiverGroups now have DSM (MainPort) and DSM (FlexiPort) options.

For DSM2 protocol there is an explicit resolution bit in the stream, so
the DSM2 should be selected. For DSMX there is no such bit, and user
should choose the resolution from the list configuring the spektrum port.
ReceiverGroups have single DSM option which is handled by the same driver.

Downside: this implementation saves received frame first, unrolls by the
end of frame. This should be ok, but may be improved by unrolling channels
on the fly in the rx callback.

Another minor difference is that a ChannelGroup is now bound to port:
DSM (MainPort) or DSM (FlexiPort). This was considered as acceptable
solution in order to not have 6 DSM options for each ChannelGroup and
even more in case of new DSM protocol variations.

Known problem: it is not possible to choose same protocols like
DSM2/DSM2 for two ports. It can be enabled by adding an exception to
common rule, though.

The DSMX throttle channel misbehavior (zero value) is not treated
specially yet. It should trigger the failsafe being out of bounds.
More info and data dumps are required to handle this properly.
2011-10-30 19:29:03 +02:00
Oleg Semyonov
a19bbba858 Merge branch 'next' into os/alternative_spektrum_driver 2011-10-25 11:55:05 +03:00
James Cotton
27bf2b383e Merge remote-tracking branch 'origin/james/remap_outputs' into next 2011-10-23 18:35:25 -05:00