Get the OS running, use the serial for console
Signed-off-by: Keith Packard <keithp@keithp.com>
--- /dev/null
+ao_product.h
+nucleo-*.elf
ao_pins.h \
ao_arch.h \
ao_arch_funcs.h \
ao_pins.h \
ao_arch.h \
ao_arch_funcs.h \
+ ao_exti.h \
+ ao_product.h \
ao_clock.c \
ao_timer.c \
ao_interrupt.c \
ao_clock.c \
ao_timer.c \
ao_interrupt.c \
+ ao_product.c \
+ ao_romconfig.c \
+ ao_led.c \
+ ao_task.c \
+ ao_panic.c \
+ ao_stdio.c \
+ ao_serial_stm.c \
+ ao_usb_stm.c \
+ ao_cmd.c
+
+PRODUCT=Nucleo-f103
+PRODUCT_DEF=-DNUCLEO_F103
+IDPRODUCT=0x000a
CFLAGS = $(PRODUCT_DEF) $(STM32F1_CFLAGS)
CFLAGS = $(PRODUCT_DEF) $(STM32F1_CFLAGS)
all: $(PROG) $(HEX)
$(PROG): Makefile $(OBJ)
all: $(PROG) $(HEX)
$(PROG): Makefile $(OBJ)
- $(call quiet,CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) --oslib=semihost
+ $(call quiet,CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
#define AO_RCC_CFGR_HPRE_DIV STM_RCC_CFGR_HPRE_DIV_1
#define AO_RCC_CFGR_ADCPRE STM_RCC_CFGR_ADCPRE_6
#define AO_RCC_CFGR_HPRE_DIV STM_RCC_CFGR_HPRE_DIV_1
#define AO_RCC_CFGR_ADCPRE STM_RCC_CFGR_ADCPRE_6
+#define HAS_BEEP 0
+#define HAS_USB 1
+
+#define HAS_USB_PULLUP 1
+#define AO_USB_PULLUP_PORT (&stm_gpiob)
+#define AO_USB_PULLUP_PIN 12
+
+
#define HAS_LED 1
#define LED_0_PORT (&stm_gpioa)
#define LED_0_PIN 5
#define AO_LED_GREEN (1 << 0)
#define HAS_LED 1
#define LED_0_PORT (&stm_gpioa)
#define LED_0_PIN 5
#define AO_LED_GREEN (1 << 0)
+#define AO_LED_PANIC AO_LED_GREEN
+
+#define HAS_SERIAL_1 1
+#define USE_SERIAL_1_STDIN 1
+#define SERIAL_1_PA9_PA10 1
-void
-ao_delay(AO_TICK_TYPE ticks)
- uint32_t then = ao_time();
- while ((int32_t) (ao_time() - then) < (int32_t) ticks)
- ao_arch_nop();
+ for (;;) {
+ ao_led_for(AO_LED_GREEN, 50);
+ ao_delay(50);
+ }
+static struct ao_task blink_task;
+
int main(void)
{
ao_clock_init();
int main(void)
{
ao_clock_init();
- for (;;) {
- ao_led_for(AO_LED_GREEN, 50);
- ao_delay(50);
- }
+ ao_timer_init();
+ ao_serial_init();
+ ao_usb_init();
+ ao_task_init();
+ ao_cmd_init();
+ ao_add_task(&blink_task, blink, "blink");
+ ao_start_scheduler();