diff options
author | Bdale Garbee <bdale@gag.com> | 2013-05-21 09:39:13 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2013-05-21 09:39:13 -0600 |
commit | 28d7fe977b17a861a8197c1412915a24978db38e (patch) | |
tree | 772eb0451be9d915aa6307635e3f5557311c9134 | |
parent | 97b80e3fef28d367a5ed1d18893accd1416cdf3f (diff) | |
parent | a261bdbba3301cd29c1be7ba85f695f7b434cb03 (diff) |
Merge branch 'branch-1.2' into debian
-rw-r--r-- | ChangeLog | 120 | ||||
-rw-r--r-- | altoslib/AltosRecordMM.java | 4 | ||||
-rw-r--r-- | doc/Makefile | 3 | ||||
-rw-r--r-- | doc/altusmetrum.xsl | 28 | ||||
-rw-r--r-- | doc/release-notes-1.2.1.xsl | 83 | ||||
-rw-r--r-- | doc/release-notes-1.2.xsl | 59 | ||||
-rw-r--r-- | libaltos/Makefile.am | 2 | ||||
-rw-r--r-- | libaltos/libaltos.c | 24 | ||||
-rw-r--r-- | src/cc1111/ao_usb.c | 68 | ||||
-rw-r--r-- | src/core/ao_usb.h | 1 |
10 files changed, 288 insertions, 104 deletions
@@ -1,9 +1,129 @@ +commit 5a329c7f588334df7443b47c8f478ebadf312f62 +Merge: 9b13822 03fe10e +Author: Bdale Garbee <bdale@gag.com> +Date: Tue May 21 09:31:48 2013 -0600 + + Merge branch 'branch-1.2' of ssh://git.gag.com/scm/git/fw/altos into branch-1.2 + +commit 9b138221283f0b8e8df5a799f75d73fd456028a0 +Author: Bdale Garbee <bdale@gag.com> +Date: Tue May 21 09:29:30 2013 -0600 + + update changelog for 1.2.1 release + commit 6f51726b1c04940c5be3b6f320d6aa529afff9ca Author: Bdale Garbee <bdale@gag.com> Date: Tue May 21 09:28:53 2013 -0600 update configure.ac to reflect version 1.2.1 +commit 03fe10efd307da10e35c5f6a46f0c8b1a3888c57 +Author: Keith Packard <keithp@keithp.com> +Date: Mon May 20 21:41:01 2013 -0700 + + doc: Update description of graph window to note new tabs (config and map) + + Signed-off-by: Keith Packard <keithp@keithp.com> + +commit db9ea188aebe5299f46bbd4fca5317c1bc95f3f5 +Author: Keith Packard <keithp@keithp.com> +Date: Mon May 20 21:37:20 2013 -0700 + + Create release notes for 1.2.1 + + Move most of the 1.2 content to the 1.2.1 block + + Signed-off-by: Keith Packard <keithp@keithp.com> + +commit 51f2c4ce2692ee3e898b4e94232c45a608932c15 +Author: Keith Packard <keithp@keithp.com> +Date: Sun May 19 20:35:42 2013 -0700 + + altos/telemega: The last two igniters are apogee and main + + Not the first two. TeleMega v0.3 has these marked on the silk + + Signed-off-by: Keith Packard <keithp@keithp.com> + +commit 8d40c37bae0c58037f267e54de40071cd19c931d +Author: Keith Packard <keithp@keithp.com> +Date: Fri May 17 03:27:20 2013 -0700 + + libaltos: Build the linux library targets when doing a 'fat' build + + These are necessary for the fat release, so make sure they're built then. + + Signed-off-by: Keith Packard <keithp@keithp.com> + +commit fbe7857e371fa8ffa726fda2b43d4eddd551eaa4 +Author: Keith Packard <keithp@keithp.com> +Date: Fri May 17 03:34:50 2013 -0700 + + libaltos: use PurgeComm in Windows altos_close to abort in-progress ops + + Instead of manually signalling the related events, use PurgeComm which + can then abort the operations itself. Also make sure all of the + relevant handles are set to INVALID before closing them to avoid race conditions. + + Signed-off-by: Keith Packard <keithp@keithp.com> + +commit 3b457ff8d43630c04e0cb22bb3a2765be5e188bd +Author: Keith Packard <keithp@keithp.com> +Date: Fri May 17 03:21:08 2013 -0700 + + altos/cc1111: Hack on USB driver to make Windows happy + + The Windows modem driver is quite chatty at startup time, getting and + setting the comm parameters each time the device is opened. Sometimes, + when setting the parameters, the cc1111 would STALL EP0. + + Most of the time, Windows would happily pass this as an error back to + AltosUI which would then re-try the open (and succeed, most of the + time). + + Sometimes, Windows would stall for 30 seconds before passing the error + back. This made the whole UI freeze, and I suspect most people assumed + our app had died. + + A bit of analysis with the beagle USB sniffer and I discovered the + STALL settings, but there wasn't any correlation between the data on + the wire and when the STALL would be generated. + + So, I found a couple of other cc1111 USB stacks on the net and just + looked to see how our driver differed. There wasn't anything clearly + related, but there were a list of small differences: + + 1) Other drivers didn't bother waiting for the hardware to + ack the USBADDR setting; doing it this way means we can set + the address *before* acking the setup packet. It'll get + set eventually, at which point the device will start responding to + packets again. + + Easy to fix, and saves a bit of code space too. + + 2) The other drivers set the STALL bit for setup packets which aren't + understood. This shouldn't have any effect on 'good' systems as + those shouldn't ever be generating bogus setup packets anyways. + + The driver already handled the STALL state in the interrupt + handler, the only requirement was to figure out when to explicitly + set the STALL bit. + + That required moving the state updating code from the start of the + ep0 setup handling to the end, after the setup packet had been + examined and data queued in or out as appropriate. + + 3) Our driver explicitly queued an IN packet for any setup request + that wasn't waiting for an OUT pack. This appears to tie in with + the USBADDR change above as before I made that change, this change + caused the driver to fail to respond to most setup packets. + + This was simple once the above change was made, just move the + generation of the IN packet inside the code that switched to the + IN state. + + Signed-off-by: Keith Packard <keithp@keithp.com> + commit 7699a55aed3a9a7daeb4c6a5a9a280f43edf455f Author: Bdale Garbee <bdale@gag.com> Date: Thu May 16 00:34:26 2013 -0600 diff --git a/altoslib/AltosRecordMM.java b/altoslib/AltosRecordMM.java index bf64192c..d697111c 100644 --- a/altoslib/AltosRecordMM.java +++ b/altoslib/AltosRecordMM.java @@ -71,11 +71,11 @@ public class AltosRecordMM extends AltosRecord { } public double main_voltage() { - return pyro(sense[1]); + return pyro(sense[5]); } public double drogue_voltage() { - return pyro(sense[0]); + return pyro(sense[4]); } public double temperature() { diff --git a/doc/Makefile b/doc/Makefile index 7c4da29e..06346a2d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -10,7 +10,8 @@ RELNOTES=\ release-notes-1.0.1.html \ release-notes-1.1.html \ release-notes-1.1.1.html \ - release-notes-1.2.html + release-notes-1.2.html \ + release-notes-1.2.1.html RELNOTES_XSL=$(RELNOTES:.html=.xsl) HTML=altusmetrum.html altos.html telemetry.html companion.html micropeak.html $(RELNOTES) diff --git a/doc/altusmetrum.xsl b/doc/altusmetrum.xsl index 294f30ac..dfd72ab4 100644 --- a/doc/altusmetrum.xsl +++ b/doc/altusmetrum.xsl @@ -36,12 +36,20 @@ </legalnotice> <revhistory> <revision> - <revnumber>1.2</revnumber> - <date>14 April 2013</date> + <revnumber>1.2.1</revnumber> + <date>21 May 2013</date> <revremark> Updated for software version 1.2. Version 1.2 adds support for TeleBT and AltosDroid. It also adds a few minor features - and fixes a few minor bugs in AltosUI and the AltOS firmware. + and fixes bugs in AltosUI and the AltOS firmware. + </revremark> + </revision> + <revision> + <revnumber>1.2</revnumber> + <date>18 April 2013</date> + <revremark> + Updated for software version 1.2. Version 1.2 adds support + for MicroPeak and the MicroPeak USB interface. </revremark> </revision> <revision> @@ -1105,14 +1113,15 @@ NAR #88757, TRA #12200 flash memory. </para> <para> - Once a flight record is selected, a window with two tabs is + Once a flight record is selected, a window with four tabs is opened. The first tab contains a graph with acceleration (blue), velocity (green) and altitude (red) of the flight, - measured in metric units. The - apogee(yellow) and main(magenta) igniter voltages are also - displayed; high voltages indicate continuity, low voltages - indicate open circuits. The second tab contains some basic - flight statistics. + measured in metric units. The apogee(yellow) and main(magenta) + igniter voltages are also displayed; high voltages indicate + continuity, low voltages indicate open circuits. The second + tab lets you configure which data to show in the graph. The + third contains some basic flight statistics while the fourth + has a map with the ground track of the flight displayed. </para> <para> The graph can be zoomed into a particular area by clicking and @@ -2851,6 +2860,7 @@ NAR #88757, TRA #12200 <appendix xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Release Notes</title> + <simplesect><title>Version 1.21</title><xi:include href="release-notes-1.2.1.xsl" xpointer="xpointer(/article/*)"/></simplesect> <simplesect><title>Version 1.2</title><xi:include href="release-notes-1.2.xsl" xpointer="xpointer(/article/*)"/></simplesect> <simplesect><title>Version 1.1.1</title><xi:include href="release-notes-1.1.1.xsl" xpointer="xpointer(/article/*)"/></simplesect> <simplesect><title>Version 1.1</title><xi:include href="release-notes-1.1.xsl" xpointer="xpointer(/article/*)"/></simplesect> diff --git a/doc/release-notes-1.2.1.xsl b/doc/release-notes-1.2.1.xsl new file mode 100644 index 00000000..5f9aef01 --- /dev/null +++ b/doc/release-notes-1.2.1.xsl @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" +"/usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd"> + +<article> + <para> + Version 1.2.1 is a minor release. It adds support for TeleBT and + the AltosDroid application, provides several new features in + AltosUI and fixes some bugs in the AltOS firmware. + </para> + <para> + AltOS Firmware Changes + <itemizedlist> + <listitem> + Add support for TeleBT + </listitem> + <listitem> + In TeleMini recovery mode (when booted with the outer two + debug pins connected together), the radio parameters are also + set back to defaults (434.550MHz, N0CALL, factory radio cal). + </listitem> + <listitem> + Add support for reflashing the SkyTraq GPS chips. This + requires special host-side code which currently only exists + for Linux. + </listitem> + <listitem> + Correct Kalman filter model error covariance matrix. The + values used previously assumed continuous measurements instead + of discrete measurements. + </listitem> + <listitem> + Fix some bugs in the USB driver for TeleMetrum and TeleDongle + that affected Windows users. + </listitem> + <listitem> + Adjusted the automatic gain control parameters that affect + receive performance for TeleDongle. Field tests indicate that this + may improve receive performance somewhat. + </listitem> + </itemizedlist> + </para> + <para> + AltosUI Changes + <itemizedlist> + <listitem> + Handle missing GPS lock in 'Descent' tab. Previously, if the + GPS position of the pad was unknown, an exception would be + raised, breaking the Descent tab contents. + </listitem> + <listitem> + Improve the graph, adding tool-tips to show values near the + cursor and making the displayed set of values configurable, + adding all of the flight data as options while leaving the + default settings alone so that the graph starts by showing + height, speed and acceleration. + </listitem> + <listitem> + Make the initial position of the AltosUI top level window + configurable. Along with this change, the other windows will + pop up at 'sensible' places now, instead of on top of one + another. + </listitem> + <listitem> + Add callsign to Monitor idle window and connecting + dialogs. This makes it clear which callsign is being used so + that the operator will be aware that it must match the flight + computer value or no communication will work. + </listitem> + <listitem> + When downloading flight data, display the block number so that + the user has some sense of progress. Unfortunately, we don't + know how many blocks will need to be downloaded, but at least + it isn't just sitting there doing nothing for a long time. + </listitem> + <listitem> + Add GPS data and a map to the graph window. This lets you see + a complete summary of the flight without needing to 'replay' + the whole thing. + </listitem> + </itemizedlist> + </para> +</article> diff --git a/doc/release-notes-1.2.xsl b/doc/release-notes-1.2.xsl index b254c7b5..64ba46a9 100644 --- a/doc/release-notes-1.2.xsl +++ b/doc/release-notes-1.2.xsl @@ -4,75 +4,24 @@ <article> <para> - Version 1.2 is a minor release. It provides a few new features in AltosUI - and the AltOS firmware and fixes bugs. + Version 1.2 is a major release. It adds support for MicroPeak and + the MicroPeak USB adapter. </para> <para> AltOS Firmware Changes <itemizedlist> <listitem> - In TeleMini recovery mode (when booted with the outer two - debug pins connected together), the radio parameters are also - set back to defaults (434.550MHz, N0CALL, factory radio cal). - </listitem> - <listitem> - Add support for reflashing the SkyTraq GPS chips. This - requires special host-side code which currently only exists - for Linux. - </listitem> - <listitem> Add MicroPeak support. This includes support for the ATtiny85 processor and adaptations to the core code to allow for devices too small to run the multi-tasking scheduler. </listitem> - <listitem> - Correct Kalman filter model error covariance matrix. The - values used previously assumed continuous measurements instead - of discrete measurements. - </listitem> </itemizedlist> </para> <para> - AltosUI Changes + MicroPeak UI changes <itemizedlist> <listitem> - Handle missing GPS lock in 'Descent' tab. Previously, if the - GPS position of the pad was unknown, an exception would be - raised, breaking the Descent tab contents. - </listitem> - <listitem> - Add preliminary TeleMega support, including configuration, - data download and analysis. - </listitem> - <listitem> - Improve the graph, adding tool-tips to show values near the - cursor and making the displayed set of values configurable, - adding all of the flight data as options while leaving the - default settings alone so that the graph starts by showing - height, speed and acceleration. - </listitem> - <listitem> - Make the initial position of the AltosUI top level window - configurable. Along with this change, the other windows will - pop up at 'sensible' places now, instead of on top of one - another. - </listitem> - <listitem> - Add callsign to Monitor idle window and connecting - dialogs. This makes it clear which callsign is being used so - that the operator will be aware that it must match the flight - computer value or no communication will work. - </listitem> - <listitem> - When downloading flight data, display the block number so that - the user has some sense of progress. Unfortunately, we don't - know how many blocks will need to be downloaded, but at least - it isn't just sitting there doing nothing for a long time. - </listitem> - <listitem> - Add GPS data and a map to the graph window. This lets you see - a complete summary of the flight without needing to 'replay' - the whole thing. + Added this new application </listitem> </itemizedlist> </para> diff --git a/libaltos/Makefile.am b/libaltos/Makefile.am index b5ab1ddb..41549558 100644 --- a/libaltos/Makefile.am +++ b/libaltos/Makefile.am @@ -42,7 +42,7 @@ MINGCC64=x86_64-w64-mingw32-gcc MINGFLAGS=-Wall -DWINDOWS -DBUILD_DLL -I$(JVM_INCLUDE) MINGLIBS=-lsetupapi -fat: altos.dll altos64.dll +fat: all altos.dll altos64.dll altos.dll: $(libaltos_la_SOURCES) $(MINGCC32) -o $@ $(MINGFLAGS) -shared $(libaltos_la_SOURCES) $(MINGLIBS) diff --git a/libaltos/libaltos.c b/libaltos/libaltos.c index fc949c70..4a6363ed 100644 --- a/libaltos/libaltos.c +++ b/libaltos/libaltos.c @@ -994,6 +994,11 @@ log_message(char *fmt, ...) if (!log) log = fopen("\\temp\\altos.txt", "w"); if (log) { + SYSTEMTIME time; + GetLocalTime(&time); + fprintf (log, "%4d-%02d-%02d %2d:%02d:%02d. ", + time.wYear, time.wMonth, time.wDay, + time.wHour, time.wMinute, time.wSecond); va_start(a, fmt); vfprintf(log, fmt, a); va_end(a); @@ -1339,6 +1344,7 @@ altos_open(struct altos_device *device) file->handle = open_serial(full_name); if (file->handle != INVALID_HANDLE_VALUE) break; + altos_set_last_windows_error(); Sleep(100); } @@ -1373,13 +1379,19 @@ altos_open(struct altos_device *device) PUBLIC void altos_close(struct altos_file *file) { - if (file->handle != INVALID_HANDLE_VALUE) { - CloseHandle(file->handle); + HANDLE handle = file->handle; + if (handle != INVALID_HANDLE_VALUE) { + HANDLE ov_read = file->ov_read.hEvent; + HANDLE ov_write = file->ov_write.hEvent; + file->handle = INVALID_HANDLE_VALUE; + file->ov_read.hEvent = INVALID_HANDLE_VALUE; + file->ov_write.hEvent = INVALID_HANDLE_VALUE; + PurgeComm(handle, PURGE_RXABORT|PURGE_RXCLEAR|PURGE_TXABORT|PURGE_TXCLEAR); + Sleep(100); + CloseHandle(handle); file->handle = INVALID_HANDLE_VALUE; - SetEvent(file->ov_read.hEvent); - SetEvent(file->ov_write.hEvent); - CloseHandle(file->ov_read.hEvent); - CloseHandle(file->ov_write.hEvent); + CloseHandle(ov_read); + CloseHandle(ov_write); } } diff --git a/src/cc1111/ao_usb.c b/src/cc1111/ao_usb.c index 8bd2efdf..a655d1be 100644 --- a/src/cc1111/ao_usb.c +++ b/src/cc1111/ao_usb.c @@ -152,19 +152,17 @@ ao_usb_ep0_fill(void) *ao_usb_ep0_out_data++ = USBFIFO[0]; } -void +static void ao_usb_ep0_queue_byte(uint8_t a) { ao_usb_ep0_in_buf[ao_usb_ep0_in_len++] = a; } -void +static void ao_usb_set_address(uint8_t address) { ao_usb_running = 1; - USBADDR = address | 0x80; - while (USBADDR & 0x80) - ; + USBADDR = address; } static void @@ -191,24 +189,6 @@ ao_usb_ep0_setup(void) if (ao_usb_ep0_out_len != 0) return; - /* Figure out how to ACK the setup packet */ - if (ao_usb_setup.dir_type_recip & AO_USB_DIR_IN) { - if (ao_usb_setup.length) - ao_usb_ep0_state = AO_USB_EP0_DATA_IN; - else - ao_usb_ep0_state = AO_USB_EP0_IDLE; - } else { - if (ao_usb_setup.length) - ao_usb_ep0_state = AO_USB_EP0_DATA_OUT; - else - ao_usb_ep0_state = AO_USB_EP0_IDLE; - } - USBINDEX = 0; - if (ao_usb_ep0_state == AO_USB_EP0_IDLE) - USBCS0 = USBCS0_CLR_OUTPKT_RDY | USBCS0_DATA_END; - else - USBCS0 = USBCS0_CLR_OUTPKT_RDY; - ao_usb_ep0_in_data = ao_usb_ep0_in_buf; ao_usb_ep0_in_len = 0; switch(ao_usb_setup.dir_type_recip & AO_USB_SETUP_TYPE_MASK) { @@ -274,10 +254,39 @@ ao_usb_ep0_setup(void) } break; } - if (ao_usb_ep0_state != AO_USB_EP0_DATA_OUT) { + + /* Figure out how to ACK the setup packet and the + * next state + */ + USBINDEX = 0; + if (ao_usb_ep0_in_len) { + + /* Sending data back to the host + */ + ao_usb_ep0_state = AO_USB_EP0_DATA_IN; + USBCS0 = USBCS0_CLR_OUTPKT_RDY; if (ao_usb_setup.length < ao_usb_ep0_in_len) ao_usb_ep0_in_len = ao_usb_setup.length; ao_usb_ep0_flush(); + } else if (ao_usb_ep0_out_len) { + + /* Receiving data from the host + */ + ao_usb_ep0_state = AO_USB_EP0_DATA_OUT; + USBCS0 = USBCS0_CLR_OUTPKT_RDY; + } else if (ao_usb_setup.length) { + + /* Uh-oh, the host expected to send or receive data + * and we don't know what to do. + */ + ao_usb_ep0_state = AO_USB_EP0_STALL; + USBCS0 = USBCS0_CLR_OUTPKT_RDY | USBCS0_SEND_STALL; + } else { + + /* Simple setup packet with no data + */ + ao_usb_ep0_state = AO_USB_EP0_IDLE; + USBCS0 = USBCS0_CLR_OUTPKT_RDY | USBCS0_DATA_END; } } @@ -299,12 +308,12 @@ ao_usb_ep0(void) USBINDEX = 0; cs0 = USBCS0; if (cs0 & USBCS0_SETUP_END) { - ao_usb_ep0_state = AO_USB_EP0_IDLE; USBCS0 = USBCS0_CLR_SETUP_END; + ao_usb_ep0_state = AO_USB_EP0_IDLE; } if (cs0 & USBCS0_SENT_STALL) { + USBCS0 = 0; ao_usb_ep0_state = AO_USB_EP0_IDLE; - USBCS0 &= ~USBCS0_SENT_STALL; } if (ao_usb_ep0_state == AO_USB_EP0_DATA_IN && (cs0 & USBCS0_INPKT_RDY) == 0) @@ -318,12 +327,11 @@ ao_usb_ep0(void) break; case AO_USB_EP0_DATA_OUT: ao_usb_ep0_fill(); - if (ao_usb_ep0_out_len == 0) - ao_usb_ep0_state = AO_USB_EP0_IDLE; USBINDEX = 0; - if (ao_usb_ep0_state == AO_USB_EP0_IDLE) + if (ao_usb_ep0_out_len == 0) { + ao_usb_ep0_state = AO_USB_EP0_IDLE; USBCS0 = USBCS0_CLR_OUTPKT_RDY | USBCS0_DATA_END; - else + } else USBCS0 = USBCS0_CLR_OUTPKT_RDY; break; } diff --git a/src/core/ao_usb.h b/src/core/ao_usb.h index 4476ee6b..6bc77608 100644 --- a/src/core/ao_usb.h +++ b/src/core/ao_usb.h @@ -114,6 +114,7 @@ extern __code __at (0x00aa) uint8_t ao_usb_descriptors []; #define AO_USB_EP0_IDLE 0 #define AO_USB_EP0_DATA_IN 1 #define AO_USB_EP0_DATA_OUT 2 +#define AO_USB_EP0_STALL 3 #define LE_WORD(x) ((x)&0xFF),((uint8_t) (((uint16_t) (x))>>8)) |