Skip to content

Commit 5240c06

Browse files
committed
altos/lpcxpresso: Update for 11u24 board
This updates the lpcxpresso demo to support the 11u24 board with serial connected like telegps v3.0 on p1_13/p1_14 Signed-off-by: Keith Packard <[email protected]>
1 parent cbc7a40 commit 5240c06

File tree

5 files changed

+76
-27
lines changed

5 files changed

+76
-27
lines changed

src/lpcxpresso/Makefile

+2-6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ INC = \
1818
#
1919
ALTOS_SRC = \
2020
ao_interrupt.c \
21+
ao_boot_chain.c \
2122
ao_romconfig.c \
2223
ao_product.c \
2324
ao_panic.c \
@@ -42,13 +43,8 @@ OBJ=$(SRC:.c=.o)
4243

4344
all: $(PROG)
4445

45-
LDFLAGS=-L../lpc -Wl,-Taltos.ld
46-
4746
$(PROG): Makefile $(OBJ)
48-
$(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS)
49-
50-
ao_product.h: ao-make-product.5c ../Version
51-
$(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
47+
$(call quiet,CC) $(LDFLAGS) -o $(PROG) $(OBJ) $(LIBS) -Wl,-Map=$(PROGNAME)-$(VERSION).map
5248

5349
$(OBJ): $(INC)
5450

src/lpcxpresso/ao_demo.c

+23-16
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,37 @@
1919
#include <ao.h>
2020
#include <ao_usb.h>
2121

22+
#if 0
23+
static void
24+
hello(void)
25+
{
26+
for (;;) {
27+
const char *s = "hello, world\r\n";
28+
char c;
29+
while ((c = *s++))
30+
ao_serial0_putchar(c);
31+
}
32+
}
33+
34+
struct ao_task hello_task;
35+
#endif
36+
2237
int
2338
main(void)
2439
{
25-
int i;
26-
ao_led_init(LEDS_AVAILABLE);
27-
ao_led_on(AO_LED_RED);
2840
ao_clock_init();
2941
ao_timer_init();
30-
42+
43+
ao_led_init();
44+
ao_led_on(AO_LED_RED);
45+
46+
ao_task_init();
47+
48+
// ao_add_task(&hello_task, hello, "hello");
49+
3150
ao_serial_init();
3251
ao_usb_init();
3352
ao_cmd_init();
34-
ao_task_init();
3553

3654
ao_start_scheduler();
37-
38-
for (;;) {
39-
ao_led_off(AO_LED_RED);
40-
for (;;)
41-
if (ao_tick_count & 1)
42-
break;
43-
ao_led_on(AO_LED_RED);
44-
for (;;)
45-
if (!(ao_tick_count & 1))
46-
break;
47-
}
4855
}

src/lpcxpresso/ao_pins.h

+8-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#define HAS_BEEP 0
2020

21+
#define IS_FLASH_LOADER 0
22+
2123
/* Crystal on the board */
2224
#define AO_LPC_CLKIN 12000000
2325

@@ -35,17 +37,18 @@
3537
#define LEDS_AVAILABLE AO_LED_RED
3638

3739
#define HAS_USB 1
38-
39-
#define HAS_USB_CONNECT 1
40-
#define HAS_USB_VBUS 1
40+
#define HAS_USB_PULLUP 1
41+
#define AO_USB_PULLUP_PORT 1
42+
#define AO_USB_PULLUP_PIN 23
4143

4244
#define PACKET_HAS_SLAVE 0
4345

4446
/* USART */
4547

46-
#define HAS_SERIAL 1
48+
#define HAS_SERIAL_0 1
4749
#define USE_SERIAL_0_STDIN 1
48-
#define SERIAL_0_18_19 1
50+
#define SERIAL_0_18_19 0
51+
#define SERIAL_1_13_14 1
4952
#define SERIAL_0_14_15 0
5053
#define SERIAL_0_17_18 0
5154
#define SERIAL_0_26_27 0

src/lpcxpresso/flash-loader/Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# AltOS flash loader build
3+
#
4+
#
5+
6+
TOPDIR=../..
7+
HARDWARE=lpcxpresso
8+
include $(TOPDIR)/lpc/Makefile-flash.defs

src/lpcxpresso/flash-loader/ao_pins.h

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright © 2023 Keith Packard <[email protected]>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful, but
10+
* WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License along
15+
* with this program; if not, write to the Free Software Foundation, Inc.,
16+
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17+
*/
18+
19+
#ifndef _AO_PINS_H_
20+
#define _AO_PINS_H_
21+
22+
#include <ao_flash_lpc_pins.h>
23+
24+
/* pin next to lower right corner GND pin */
25+
#define AO_BOOT_PIN 1
26+
#define AO_BOOT_APPLICATION_GPIO 1
27+
#define AO_BOOT_APPLICATION_PIN 16
28+
#define AO_BOOT_APPLICATION_VALUE 1
29+
#define AO_BOOT_APPLICATION_MODE AO_EXTI_MODE_PULL_UP
30+
31+
#define HAS_USB_PULLUP 1
32+
#define AO_USB_PULLUP_PORT 1
33+
#define AO_USB_PULLUP_PIN 23
34+
35+
#endif /* _AO_PINS_H_ */

0 commit comments

Comments
 (0)