diff options
author | Keith Packard <keithp@keithp.com> | 2013-05-17 03:36:47 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-05-17 03:50:07 -0700 |
commit | ac089d4fb930b7dbc4161259fd9bddba94395ebc (patch) | |
tree | ee17589ffa43eee5be5e1eb1b4fac67ebb581624 /src/lpcxpresso | |
parent | 185e6d15bcda229949a984910d7394203d301db9 (diff) |
altos/lpc: Get USB working
The lpc demo now has a USB command line.
Also allocates system stack so we know when ram is tight at build time
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lpcxpresso')
-rw-r--r-- | src/lpcxpresso/Makefile | 2 | ||||
-rw-r--r-- | src/lpcxpresso/ao_demo.c | 26 | ||||
-rw-r--r-- | src/lpcxpresso/ao_pins.h | 5 |
3 files changed, 10 insertions, 23 deletions
diff --git a/src/lpcxpresso/Makefile b/src/lpcxpresso/Makefile index bac222cc..3745f283 100644 --- a/src/lpcxpresso/Makefile +++ b/src/lpcxpresso/Makefile @@ -23,8 +23,10 @@ ALTOS_SRC = \ ao_panic.c \ ao_led_lpc.c \ ao_task.c \ + ao_cmd.c \ ao_timer_lpc.c \ ao_serial_lpc.c \ + ao_usb_lpc.c \ ao_stdio.c PRODUCT=LpcDemo-v0.0 diff --git a/src/lpcxpresso/ao_demo.c b/src/lpcxpresso/ao_demo.c index eae9503e..0c931611 100644 --- a/src/lpcxpresso/ao_demo.c +++ b/src/lpcxpresso/ao_demo.c @@ -15,24 +15,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include "ao.h" - -struct ao_task demo_task; - -static void demo(void) { - for (;;) { - ao_delay(100); - ao_led_toggle(AO_LED_RED); - } -} - -static struct ao_task serial_task; - -static void serial(void) { - for (;;) { - printf ("hello, world\n"); - } -} +#include <ao.h> +#include <ao_usb.h> int main(void) @@ -44,12 +28,10 @@ main(void) ao_timer_init(); ao_serial_init(); - + ao_usb_init(); + ao_cmd_init(); ao_task_init(); - ao_add_task(&demo_task, demo, "demo"); - ao_add_task(&serial_task, serial, "serial"); - ao_start_scheduler(); for (;;) { diff --git a/src/lpcxpresso/ao_pins.h b/src/lpcxpresso/ao_pins.h index 7748f73c..c0074ce2 100644 --- a/src/lpcxpresso/ao_pins.h +++ b/src/lpcxpresso/ao_pins.h @@ -34,7 +34,10 @@ #define LEDS_AVAILABLE AO_LED_RED -#define HAS_USB 0 +#define HAS_USB 1 + +#define HAS_USB_CONNECT 1 +#define HAS_USB_VBUS 1 #define PACKET_HAS_SLAVE 0 |