From: Bdale Garbee Date: Sat, 10 Dec 2022 09:10:54 +0000 (-0700) Subject: first pass at creating firmware for lpc on QuantiMotor v1 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=119583d7615750944687660f5c8b82e153b4189b;p=fw%2Faltos first pass at creating firmware for lpc on QuantiMotor v1 --- diff --git a/src/lpc/ao_adc_lpc.c b/src/lpc/ao_adc_lpc.c index 29d3668c..411015d4 100644 --- a/src/lpc/ao_adc_lpc.c +++ b/src/lpc/ao_adc_lpc.c @@ -143,7 +143,7 @@ ao_adc_dump(void) #ifdef AO_ADC_DUMP AO_ADC_DUMP(&packet); #else - printf("tick: %5u", packet.tick); + printf("tick: %5lu", packet.tick); d = (int16_t *) (&packet.adc); for (i = 0; i < AO_ADC_NUM; i++) printf (" %2d: %5d", i, d[i]); diff --git a/src/quantimotor-v1/ao_pins.h b/src/quantimotor-v1/ao_pins.h new file mode 100644 index 00000000..fbd77c11 --- /dev/null +++ b/src/quantimotor-v1/ao_pins.h @@ -0,0 +1,80 @@ +/* + * Copyright © 2022 Bdale Garbee + * GPLv3 + */ + +#include +#include + +int +main(void) +{ + ao_clock_init(); + ao_task_init(); + ao_timer_init(); + ao_exti_init(); + + ao_adc_init(); + + ao_usb_init(); + + ao_cmd_init(); + ao_config_init(); + + ao_start_scheduler(); +} diff --git a/src/quantimotor-v1/flash-loader/Makefile b/src/quantimotor-v1/flash-loader/Makefile new file mode 100644 index 00000000..9927e810 --- /dev/null +++ b/src/quantimotor-v1/flash-loader/Makefile @@ -0,0 +1,8 @@ +# +# AltOS flash loader build +# +# + +TOPDIR=../.. +HARDWARE=quantimotor-v1 +include $(TOPDIR)/lpc/Makefile-flash.defs diff --git a/src/quantimotor-v1/flash-loader/ao_pins.h b/src/quantimotor-v1/flash-loader/ao_pins.h new file mode 100644 index 00000000..3a69cd6c --- /dev/null +++ b/src/quantimotor-v1/flash-loader/ao_pins.h @@ -0,0 +1,21 @@ +/* + * Copyright © 2022 Bdale Garbee + * GPLv3 + */ + +#ifndef _AO_PINS_H_ +#define _AO_PINS_H_ + +#include + +#define AO_BOOT_PIN 1 +#define AO_BOOT_APPLICATION_GPIO 0 +#define AO_BOOT_APPLICATION_PIN 7 +#define AO_BOOT_APPLICATION_VALUE 1 +#define AO_BOOT_APPLICATION_MODE AO_EXTI_MODE_PULL_UP + +#define HAS_USB_PULLUP 1 +#define AO_USB_PULLUP_PORT 0 +#define AO_USB_PULLUP_PIN 20 + +#endif /* _AO_PINS_H_ */