From: Keith Packard Date: Tue, 28 Mar 2023 04:25:43 +0000 (-0700) Subject: altos: Allow ports to use type other than 'void *' for gpio block X-Git-Tag: 1.9.16~1^2~18 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=4d9874c473887a4f43ba14ac855a2db00a740d2d altos: Allow ports to use type other than 'void *' for gpio block LPC uses integers while everyone else has a struct for each gpio block. Signed-off-by: Keith Packard --- diff --git a/src/drivers/ao_led.c b/src/drivers/ao_led.c index 009e9bc2..683d4aff 100644 --- a/src/drivers/ao_led.c +++ b/src/drivers/ao_led.c @@ -19,7 +19,7 @@ #include "ao.h" static const struct { - void *port; + ao_gpio_t port; uint8_t pin; } ao_leds[] = { #ifdef LED_0_PORT diff --git a/src/kernel/ao.h b/src/kernel/ao.h index d714cecb..b3f780f5 100644 --- a/src/kernel/ao.h +++ b/src/kernel/ao.h @@ -40,6 +40,11 @@ extern char ao_getchar(void); #define HAS_TASK 1 #endif +#ifndef AO_GPIO_TYPE +#define AO_GPIO_TYPE void * +#endif + +typedef AO_GPIO_TYPE ao_gpio_t; typedef AO_PORT_TYPE ao_port_t; #ifndef AO_TICK_TYPE diff --git a/src/lpc/ao_arch.h b/src/lpc/ao_arch.h index eedac777..59f3a7ee 100644 --- a/src/lpc/ao_arch.h +++ b/src/lpc/ao_arch.h @@ -29,6 +29,7 @@ #define AO_STACK_SIZE 512 #endif +#define AO_GPIO_TYPE uint8_t #define AO_PORT_TYPE uint32_t #define AO_LED_TYPE AO_PORT_TYPE