fw/altos
22 months agoMerge branch 'mpusb'
Keith Packard [Mon, 7 May 2018 16:53:52 +0000 (09:53 -0700)]
Merge branch 'mpusb'

22 months agoaltos/mpusb-v3.0: Make it compile again
Keith Packard [Mon, 7 May 2018 16:43:27 +0000 (09:43 -0700)]
altos/mpusb-v3.0: Make it compile again

A few things have changed since this code was written.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoaltos/stmf0: leave ao_power_gpio names undefined without power management
Keith Packard [Mon, 7 May 2018 16:42:28 +0000 (09:42 -0700)]
altos/stmf0: leave ao_power_gpio names undefined without power management

Should make it more obvious at compile time that you've done something wrong.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoaltos: Add µPusb v3.0 project
Keith Packard [Wed, 20 Jan 2016 08:00:07 +0000 (00:00 -0800)]
altos: Add µPusb v3.0 project

This replaces the ft230 with a stm32f04, saving a bit of BOM
and giving us control over the firmware.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agodoc: Update pyro channel info to reflect UI changes
Keith Packard [Mon, 7 May 2018 15:58:21 +0000 (08:58 -0700)]
doc: Update pyro channel info to reflect UI changes

Use the new naming in the UI. Add lots more comments about how things work.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoaltos/test: Replace state name with 10* state value in test log. Fix raw speed
Keith Packard [Mon, 7 May 2018 15:56:32 +0000 (08:56 -0700)]
altos/test: Replace state name with 10* state value in test log. Fix raw speed

Using a state value means we can plot state changes along with the
rest of the graph. Raw speed (simple integrated acceleration) was
busted; mostly needing to skip the first accel sample.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoaltos: Eliminate height requirement for coast detect
Keith Packard [Mon, 7 May 2018 15:51:36 +0000 (08:51 -0700)]
altos: Eliminate height requirement for coast detect

We had required a minimum altitude of 100m to transition from boost to
coast. With small motors in a heavy multi-staged rocket, this can fail
to detect coast in time to light the second motor.

Also, this would fail to deploy recovery systems if the flight failed
before reaching 100m.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoUpdate version to 1.8.5.2
Keith Packard [Mon, 7 May 2018 15:50:33 +0000 (08:50 -0700)]
Update version to 1.8.5.2

Shipped some bits to Fred Taverni to test eliminating the altitude
requirement for boost detect as he stages so low.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoao-chaosread: Add support for the new flash endpoint in chaoskey
Keith Packard [Mon, 7 May 2018 04:16:25 +0000 (21:16 -0700)]
ao-chaosread: Add support for the new flash endpoint in chaoskey

This adds support for endpoint 0x87, which streams the contents of the
onboard flash to the host for firmware verification.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoaltos/chaoskey-v1.0: Add endpoint for reading flash contents
Keith Packard [Mon, 7 May 2018 04:13:02 +0000 (21:13 -0700)]
altos/chaoskey-v1.0: Add endpoint for reading flash contents

This creates another IN endpoint which provides the contents of flash
for validation of the firmware load on the host.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoaltos/stmf0: Fix up USB debug code
Keith Packard [Mon, 7 May 2018 04:11:48 +0000 (21:11 -0700)]
altos/stmf0: Fix up USB debug code

At least make it compile. In this configuration, it's dumping out IN3
endpoint register values.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoaltos/stmf0: Add IN3 alternate endpoint support
Keith Packard [Mon, 7 May 2018 04:11:02 +0000 (21:11 -0700)]
altos/stmf0: Add IN3 alternate endpoint support

This adds the code necessary to drive another IN endpoint.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoaltos/stmf0: Toggle IN2 SW_BUF bit when sending data
Keith Packard [Mon, 7 May 2018 04:09:22 +0000 (21:09 -0700)]
altos/stmf0: Toggle IN2 SW_BUF bit when sending data

This tells the hardware we're done writing data to the second input
buffer and allows it to be switched from NAK to VALID.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoaltos/kernel: Add USB descriptors for IN3
Keith Packard [Mon, 7 May 2018 04:17:32 +0000 (21:17 -0700)]
altos/kernel: Add USB descriptors for IN3

This adds the necessary descriptor information to support another IN
endpoint for applications.

Signed-off-by: Keith Packard <keithp@keithp.com>
22 months agoaltos/kernel: Define usb IN2/IN3 functions
Keith Packard [Mon, 7 May 2018 04:06:31 +0000 (21:06 -0700)]
altos/kernel: Define usb IN2/IN3 functions

These are putchar and flush functions that are used when sending data
to the additional IN2 and IN3 endpoints.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoao-bringup/turnon_telemini: Skip DFU if no DFU device is present
Keith Packard [Wed, 2 May 2018 06:47:27 +0000 (23:47 -0700)]
ao-bringup/turnon_telemini: Skip DFU if no DFU device is present

This skips running dfu-util to load the bootloader if there isn't a
suitable DFU device listed in the system, which allows an
already-flashed device to be run through the same script.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/stmf0: Set 0x0 mapping to Main Flash for boot loader
Keith Packard [Wed, 2 May 2018 06:44:00 +0000 (23:44 -0700)]
altos/stmf0: Set 0x0 mapping to Main Flash for boot loader

When DFU finishes loading firmware and jumps to the application, it
leaves the mapping of addresses starting at 0x0 set to System flash,
which prevents the boot loader from receiving interrupts and requires
a power cycle during flash & cal.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/stmf0: whitespace fix
Keith Packard [Wed, 2 May 2018 06:36:57 +0000 (23:36 -0700)]
altos/stmf0: whitespace fix

Trailing whitespace.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/stmf0: Change tests for AO_BOOT_CHAIN and AO_BOOT_PIN to #if
Keith Packard [Wed, 2 May 2018 06:36:16 +0000 (23:36 -0700)]
altos/stmf0: Change tests for AO_BOOT_CHAIN and AO_BOOT_PIN to #if

Were #ifdef, which meant that #define AO_BOOT_PIN 0 didn't work right.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltoslib: Fix Idle Monitor on TeleMega v3
Keith Packard [Sat, 28 Apr 2018 19:03:10 +0000 (12:03 -0700)]
altoslib: Fix Idle Monitor on TeleMega v3

The new IMU includes a mag sensor, and there's no separate mag sensor.

Add support for reading the mag sensor values from the IMU, separate
out v3 from previous TeleMega versions so that the code can stop
trying to read the mag sensor.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox1ihu: Pull down radio control pin in flash loader
Keith Packard [Sat, 21 Apr 2018 23:16:18 +0000 (16:16 -0700)]
altos/fox1ihu: Pull down radio control pin in flash loader

Ensures that the radio is powered down while in the flash loader.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoRemove ao_radio_cal from stm products without radios
Keith Packard [Sat, 8 Aug 2015 03:16:41 +0000 (20:16 -0700)]
Remove ao_radio_cal from stm products without radios

Products without a radio don't need this value.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agohad the sense backwards .. presence of 'attached' should put us in the loader
Bdale Garbee [Tue, 6 May 2014 06:38:33 +0000 (00:38 -0600)]
had the sense backwards .. presence of 'attached' should put us in the loader

23 months agomove signal that forces flash-loader on to PB8, active high
Bdale Garbee [Mon, 5 May 2014 23:32:22 +0000 (17:32 -0600)]
move signal that forces flash-loader on to PB8, active high

23 months agoaltos: Build fox1ihu by default
Keith Packard [Sat, 27 Apr 2013 07:36:36 +0000 (00:36 -0700)]
altos: Build fox1ihu by default

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Enable system timer in flash loader and prod watchdog with it
Keith Packard [Sat, 1 Feb 2014 08:06:30 +0000 (00:06 -0800)]
altos/fox: Enable system timer in flash loader and prod watchdog with it

This makes it possible to reflash the board without needing to disable
the watchdog.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Update ADC to fox-1 IHU Revision 2
Keith Packard [Sat, 1 Feb 2014 06:39:58 +0000 (22:39 -0800)]
altos/fox: Update ADC to fox-1 IHU Revision 2

Change ADC pin definitions to match new hardware.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Transition to current altos build environment
Keith Packard [Sat, 1 Feb 2014 01:44:45 +0000 (17:44 -0800)]
altos/fox: Transition to current altos build environment

Fix the library usage, use $(LIBS) instead of $(SAT_CLIB) -lgcc

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: update product name to show v2, enable watchdog by default
Keith Packard [Sun, 28 Apr 2013 07:42:31 +0000 (00:42 -0700)]
altos/fox: update product name to show v2, enable watchdog by default

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Run app when PD6 is low
Keith Packard [Sun, 28 Apr 2013 07:05:39 +0000 (00:05 -0700)]
altos/fox: Run app when PD6 is low

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Add fox1ihu flash loader
Keith Packard [Sat, 27 Apr 2013 23:06:48 +0000 (16:06 -0700)]
altos/fox: Add fox1ihu flash loader

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Add MRAM and SD card drivers
Keith Packard [Fri, 26 Apr 2013 04:25:12 +0000 (21:25 -0700)]
altos/fox: Add MRAM and SD card drivers

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Enable M25 driver for MRAM.
Keith Packard [Thu, 21 Mar 2013 17:16:35 +0000 (10:16 -0700)]
altos/fox: Enable M25 driver for MRAM.

The M25 driver can also talk to the MRAM chip, with a few adjustments

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Add watchdog timer
Keith Packard [Thu, 21 Mar 2013 16:49:15 +0000 (09:49 -0700)]
altos/fox: Add watchdog timer

Runs at 25Hz, can be enabled and disabled via the command line

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Turn on all of the fox lights
Keith Packard [Thu, 24 Jan 2013 05:37:24 +0000 (21:37 -0800)]
altos/fox: Turn on all of the fox lights

Fox has two red and two green LEDs

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Provide names for fox ADC channels
Keith Packard [Thu, 24 Jan 2013 05:36:18 +0000 (21:36 -0800)]
altos/fox: Provide names for fox ADC channels

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Fix up Fox ADC bits
Keith Packard [Thu, 24 Jan 2013 05:05:26 +0000 (21:05 -0800)]
altos/fox: Fix up Fox ADC bits

Update to current schematic

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: Initialize FOX adc
Keith Packard [Thu, 24 Jan 2013 04:48:04 +0000 (20:48 -0800)]
altos/fox: Initialize FOX adc

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/fox: rename fox product
Bdale Garbee [Thu, 24 Jan 2013 04:45:28 +0000 (21:45 -0700)]
altos/fox: rename fox product

It's Fox1IHU-v1 now

23 months agoaltos/fox: Add fox1ihu bringup firmware
Keith Packard [Thu, 24 Jan 2013 03:03:26 +0000 (19:03 -0800)]
altos/fox: Add fox1ihu bringup firmware

Firmware capable of testing fox1ihu hardware

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltoslib: Fix data fetching during flashing of cc1111-based devices
Keith Packard [Fri, 27 Apr 2018 00:24:51 +0000 (17:24 -0700)]
altoslib: Fix data fetching during flashing of cc1111-based devices

We want to get enough information about the target device to verify
that the new firmware matches, so fetch 512 bytes instead of just
barely enough to cover the romconfig data.

Also catch out-of-bounds accesses and handle them, in case even this
large array isn't enough.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltoslib: Keep config data accel cal in antenna up form.
Keith Packard [Thu, 26 Apr 2018 23:30:54 +0000 (16:30 -0700)]
altoslib: Keep config data accel cal in antenna up form.

Instead of letting the accel cal data live in whatever form it was
fetched in, keep it in antenna up form and provide it in whatever
orientation is necessary.

This fixes bugs in changing pad configuration where the accel cal values
from the old orientation would get used in the new orientation and
wreck them.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltoslib: Flush settings restoration commands after accel cal
Keith Packard [Thu, 26 Apr 2018 06:07:46 +0000 (23:07 -0700)]
altoslib: Flush settings restoration commands after accel cal

To avoid mangling settings when the user doesn't 'save' things,
restore the original accel cal values and orientation after finishing
accelerometer calibration.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltoslib: Remove ascending/descending from pyro config
Keith Packard [Mon, 23 Apr 2018 03:02:04 +0000 (20:02 -0700)]
altoslib: Remove ascending/descending from pyro config

Ascending and descending don't add any functionality and can confuse
people. Clears pyro configuration value when ascending or descending were
selected in the configuration so that the user knows to reset the
channel from scratch.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltoslib: Clarify terms in Mega pyro config
Keith Packard [Mon, 23 Apr 2018 03:01:01 +0000 (20:01 -0700)]
altoslib: Clarify terms in Mega pyro config

Suggestions from Bob Brown et al

Speed -> ascent rate
Height -> height above ground
Acceleration -> Vertical acceleration

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoSet version to 1.8.5.1
Keith Packard [Sat, 21 Apr 2018 23:22:16 +0000 (16:22 -0700)]
Set version to 1.8.5.1

Firmware has changed

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/flash-loader: On STM, don't include ao_usb_disable
Keith Packard [Wed, 16 Jul 2014 05:52:35 +0000 (22:52 -0700)]
altos/flash-loader: On STM, don't include ao_usb_disable

This saves a bit of space, keeping the flash loader under 4k on fox

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos: Use max of 64 previous orient values when checking pyro limits
Keith Packard [Sat, 21 Apr 2018 23:17:26 +0000 (16:17 -0700)]
altos: Use max of 64 previous orient values when checking pyro limits

Instead of checking just a single measurement to see if the
orientation is outside of the desired limits, use the maximum of 64
previous values to that rapidly changing orientation won't
accidentally enable a pyro channel if sampled at the 'wrong time'.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltos/stm: Simplify ao_usb_write a bit
Keith Packard [Sat, 21 Apr 2018 23:14:39 +0000 (16:14 -0700)]
altos/stm: Simplify ao_usb_write a bit

Remove unnecessary 'offset' param (was always passed zero). This also
makes some code conditional on that value no longer necessary.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agodoc: add release check for altusmetrum-docinfo.xml copyright
Keith Packard [Mon, 16 Apr 2018 16:46:22 +0000 (09:46 -0700)]
doc: add release check for altusmetrum-docinfo.xml copyright

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoaltosdroid: Attempt to avoid some reported altosdroid crashes
Keith Packard [Mon, 16 Apr 2018 16:45:35 +0000 (09:45 -0700)]
altosdroid: Attempt to avoid some reported altosdroid crashes

Just looking at stack traces, maybe these changes will avoid some problems?

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agomicropeak: Make reported 'max height' value show filtered max height
Keith Packard [Thu, 5 Apr 2018 23:41:20 +0000 (16:41 -0700)]
micropeak: Make reported 'max height' value show filtered max height

MicroPeak tries to filter out bogus pressure data so that the value
reported on the LED is reasonable. We want to report that same value
in the UI, which means replacing the normal mechanism for computing
max height from the time series of height data with the value computed
from the saved minimum pressure value recorded in the device.

Signed-off-by: Keith Packard <keithp@keithp.com>
23 months agoadd a warning about Google limiting per-day access until/unless we pay
Bdale Garbee [Mon, 23 Apr 2018 01:00:03 +0000 (19:00 -0600)]
add a warning about Google limiting per-day access until/unless we pay

2 years agoanother second seems to help on the very slow Acer laptop
Bdale Garbee [Sat, 31 Mar 2018 23:44:18 +0000 (17:44 -0600)]
another second seems to help on the very slow Acer laptop

2 years agoaltos: Hack up code for TeleMetrum to make it just a tracker tmgps
Keith Packard [Fri, 23 Mar 2018 23:35:47 +0000 (17:35 -0600)]
altos: Hack up code for TeleMetrum to make it just a tracker

Support for a failed TeleMetrum device that uses just the GPS receiver
and radio to create a TeleGPS-compatible device called 'tmgps'.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/ao_cc1120: Only call ao_packet_slave_stop when HAS_SLAVE
Keith Packard [Fri, 23 Mar 2018 23:34:23 +0000 (17:34 -0600)]
altos/ao_cc1120: Only call ao_packet_slave_stop when HAS_SLAVE

Don't try to disable packet slave mode when the product doesn't
support packet slave mode.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoadd a paragraph to the intro pointing to the altusmetrum email list
Bdale Garbee [Wed, 21 Mar 2018 00:25:43 +0000 (18:25 -0600)]
add a paragraph to the intro pointing to the altusmetrum email list

2 years agodoc: update copyright year in doc/altusmetrum-docinfo.xml
Bdale Garbee [Sun, 18 Mar 2018 21:42:48 +0000 (15:42 -0600)]
doc: update copyright year in doc/altusmetrum-docinfo.xml

2 years agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Sun, 18 Mar 2018 21:33:44 +0000 (15:33 -0600)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

2 years agoBump version to 1.8.5
Keith Packard [Sat, 17 Mar 2018 18:26:29 +0000 (11:26 -0700)]
Bump version to 1.8.5

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agodoc: Add release notes for 1.8.5
Keith Packard [Sat, 17 Mar 2018 18:25:00 +0000 (11:25 -0700)]
doc: Add release notes for 1.8.5

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/stmf0: Add some common definitions for flash loaders
Keith Packard [Fri, 16 Mar 2018 21:54:04 +0000 (14:54 -0700)]
altos/stmf0: Add some common definitions for flash loaders

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos: Make panic beeps use fixed frequencies
Keith Packard [Fri, 16 Mar 2018 21:53:14 +0000 (14:53 -0700)]
altos: Make panic beeps use fixed frequencies

This ensures that the beeps will work even before the configuration
has been loaded.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoao-usbload: Flip product names in loader error message
Keith Packard [Fri, 16 Mar 2018 21:52:09 +0000 (14:52 -0700)]
ao-usbload: Flip product names in loader error message

I was reversing the 'target' vs 'image' names in the error message,
leading to a bit of confusion.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoao-bringup: Check for Loader USB id before attempting dfu-util
Keith Packard [Fri, 16 Mar 2018 21:51:22 +0000 (14:51 -0700)]
ao-bringup: Check for Loader USB id before attempting dfu-util

This lets me restart the turnon process after the boot loader has been
flashed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agochaoskey: Create unified ROM image with both loader and app
Keith Packard [Fri, 16 Mar 2018 21:50:29 +0000 (14:50 -0700)]
chaoskey: Create unified ROM image with both loader and app

Flash the whole thing all at once to reduce the number of steps during
turnon.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoao-bringup: Don't wait for user when testing EasyMini igniters
Keith Packard [Fri, 16 Mar 2018 21:49:04 +0000 (14:49 -0700)]
ao-bringup: Don't wait for user when testing EasyMini igniters

I always have the LEDs ready to go before starting the turnon process.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Mon, 12 Feb 2018 23:38:57 +0000 (16:38 -0700)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

2 years agoAdd TeleGPS v2.0 binaries to distribution
Keith Packard [Mon, 12 Feb 2018 23:36:12 +0000 (15:36 -0800)]
Add TeleGPS v2.0 binaries to distribution

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agolibaltos: Use case-insensitive compare when matching BT MACs
Keith Packard [Sun, 14 Jan 2018 05:29:08 +0000 (21:29 -0800)]
libaltos: Use case-insensitive compare when matching BT MACs

We use the BT MAC vendor portion to figure out which port to connect
to as that is simpler and takes less network traffic than actually
doing discovery. However, on Windows, we were generating the address
in lower case and comparing against upper case vendors, which didn't
work out too well.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltoslib/altosuilib: Validate rom image is for target device
Keith Packard [Sat, 13 Jan 2018 06:27:41 +0000 (22:27 -0800)]
altoslib/altosuilib: Validate rom image is for target device

This should avoid mis-programming devices with incorrect firmware.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Move ao-scheme to a separate repository
Keith Packard [Thu, 11 Jan 2018 07:11:40 +0000 (23:11 -0800)]
altos/scheme: Move ao-scheme to a separate repository

This way it can be incorporated into multiple operating systems more easily.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Allow unicode in lexer
Keith Packard [Mon, 8 Jan 2018 21:46:17 +0000 (13:46 -0800)]
altos/scheme: Allow unicode in lexer

This just passes any bytes with the high bit set through the system so
programs can include UTF-8 in strings and symbols. What the heck.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/lambdakey-v1.0: Add LED function back in
Keith Packard [Mon, 8 Jan 2018 07:06:51 +0000 (23:06 -0800)]
altos/lambdakey-v1.0: Add LED function back in

We've made things smaller, so there's (barely) space for this now.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: remove debug code from vector write
Keith Packard [Mon, 8 Jan 2018 07:06:22 +0000 (23:06 -0800)]
altos/scheme: remove debug code from vector write

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Allow individual lisp keywords to be feature-conditional
Keith Packard [Mon, 8 Jan 2018 07:05:02 +0000 (23:05 -0800)]
altos/scheme: Allow individual lisp keywords to be feature-conditional

This lets us build a smaller lisp that is just missing some aliases
for existing functionality to save rom space.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Split tests out from build sources
Keith Packard [Mon, 8 Jan 2018 07:04:22 +0000 (23:04 -0800)]
altos/scheme: Split tests out from build sources

Run tests on both tiny and full scheme test programs.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/stmf0: Use double buffering for ChaosKey
Keith Packard [Mon, 8 Jan 2018 05:44:39 +0000 (21:44 -0800)]
altos/stmf0: Use double buffering for ChaosKey

This improves the USB performance of ChaosKey so that it doesn't NAK
during data transfers at all.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoao-chaosread: add --raw and --cooked flags
Keith Packard [Mon, 8 Jan 2018 05:43:22 +0000 (21:43 -0800)]
ao-chaosread: add --raw and --cooked flags

Allow reading from the cooked endpoint as well as the raw one.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/stmf0: use double buffering for USB rx data
Keith Packard [Mon, 8 Jan 2018 01:43:42 +0000 (17:43 -0800)]
altos/stmf0: use double buffering for USB rx data

This also allows us to stop shadowing USB rx buffers in system ram

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/stmf0: Use double buffering for USB tx data
Keith Packard [Sun, 7 Jan 2018 20:43:13 +0000 (12:43 -0800)]
altos/stmf0: Use double buffering for USB tx data

This shouldn't have much of an effect, but shows how double buffering
works.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/stmf0: Stop shadowing USB tx buffers in system RAM
Keith Packard [Sun, 7 Jan 2018 19:51:07 +0000 (11:51 -0800)]
altos/stmf0: Stop shadowing USB tx buffers in system RAM

Use the 16-bit USB memory directly, avoiding the buffer space and the copy

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/stmf0: Remove packet counters from non-debug build
Keith Packard [Sun, 7 Jan 2018 19:49:09 +0000 (11:49 -0800)]
altos/stmf0: Remove packet counters from non-debug build

These counters are only useful for helping debug the USB driver.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/kernel: Use ao_put_string for syntax error message
Keith Packard [Sun, 7 Jan 2018 19:47:57 +0000 (11:47 -0800)]
altos/kernel: Use ao_put_string for syntax error message

Avoid using puts, which can be a large library function.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/lambdakey-v1.0: Switch back to command buffered input
Keith Packard [Sun, 7 Jan 2018 02:11:19 +0000 (18:11 -0800)]
altos/lambdakey-v1.0: Switch back to command buffered input

Instead of just reading from stdin with no echo or editing.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Add ports. Split scheme code up.
Keith Packard [Sun, 7 Jan 2018 01:29:10 +0000 (17:29 -0800)]
altos/scheme: Add ports. Split scheme code up.

And lots of other changes, including freeing unreferenced atoms.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: add 'install' target to install both test and tiny test
Keith Packard [Sun, 7 Jan 2018 01:21:45 +0000 (17:21 -0800)]
altos/scheme: add 'install' target to install both test and tiny test

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Add vector and string funcs. Test everybody.
Keith Packard [Thu, 4 Jan 2018 10:28:13 +0000 (02:28 -0800)]
altos/scheme: Add vector and string funcs. Test everybody.

Add a bunch of string and vector functions from r7rs. I think most
everything is here now.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Accept more escaped character constants
Keith Packard [Thu, 4 Jan 2018 10:27:11 +0000 (02:27 -0800)]
altos/scheme: Accept more escaped character constants

Allow all those specified in r7rs

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Allow make-vector value param to be optional
Keith Packard [Thu, 4 Jan 2018 10:26:21 +0000 (02:26 -0800)]
altos/scheme: Allow make-vector value param to be optional

It can default to #f

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Add builtin list-tail
Keith Packard [Thu, 4 Jan 2018 10:25:45 +0000 (02:25 -0800)]
altos/scheme: Add builtin list-tail

This is used enough to warrant a builtin, rather than lisp implementation

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Fix macro-detection debugging
Keith Packard [Thu, 4 Jan 2018 10:24:15 +0000 (02:24 -0800)]
altos/scheme: Fix macro-detection debugging

Just update to use ao_scheme_printf

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: add make-string builtin
Keith Packard [Thu, 4 Jan 2018 10:23:40 +0000 (02:23 -0800)]
altos/scheme: add make-string builtin

Allocate a blank string.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Make constant built pool as large as possible
Keith Packard [Thu, 4 Jan 2018 10:22:02 +0000 (02:22 -0800)]
altos/scheme: Make constant built pool as large as possible

This allows building with as much constant data as will fit.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Make for-each tail recursive
Keith Packard [Wed, 3 Jan 2018 22:58:57 +0000 (14:58 -0800)]
altos/scheme: Make for-each tail recursive

Provides a native version of for-each that is tail recursive, rather
than having it just use map and discard the return value.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Add start/end args to vector->list
Keith Packard [Wed, 3 Jan 2018 22:57:39 +0000 (14:57 -0800)]
altos/scheme: Add start/end args to vector->list

This is an r7rs extension which allows you to extract a subset of the
vector.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: fix parsing of vector followed by list
Keith Packard [Wed, 3 Jan 2018 22:56:15 +0000 (14:56 -0800)]
altos/scheme: fix parsing of vector followed by list

The 'parsing a vector' state value wasn't getting cleared at the end
of the vector, so that (#(1 2) (3 4) returned (#(1 2) #(3 4)

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: support %x format for scheme printf
Keith Packard [Wed, 3 Jan 2018 22:55:24 +0000 (14:55 -0800)]
altos/scheme: support %x format for scheme printf

read debugging uses this format.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoaltos/scheme: Add support for hex, octal and binary constants
Keith Packard [Wed, 3 Jan 2018 22:53:48 +0000 (14:53 -0800)]
altos/scheme: Add support for hex, octal and binary constants

Signed-off-by: Keith Packard <keithp@keithp.com>
2 years agoneed to push telegps-v2.0 loader .bin file to corporate repo, too
Bdale Garbee [Wed, 3 Jan 2018 20:43:29 +0000 (14:43 -0600)]
need to push telegps-v2.0 loader .bin file to corporate repo, too