From 6fec7b5affd223c18bad78377d7655af958dffc2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 25 Feb 2019 16:40:16 -0700 Subject: altos: Fix several mis-specified time types Make sure AO_TICK_TYPE is used "everywhere", instead of uint16_t or other. Signed-off-by: Keith Packard --- src/attiny/ao_clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/attiny') diff --git a/src/attiny/ao_clock.c b/src/attiny/ao_clock.c index d722d568..2ac0500b 100644 --- a/src/attiny/ao_clock.c +++ b/src/attiny/ao_clock.c @@ -28,7 +28,7 @@ ISR(TIMER1_COMPA_vect) ao_wakeup((void *) &ao_tick_count); } -uint16_t +AO_TICK_TYPE ao_time(void) { uint16_t r; -- cgit v1.2.3 From 0448b9b638f8599633227a639ef9d8572780bbd9 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 25 Feb 2019 16:41:45 -0700 Subject: altos: Change default time type to 32-bits Offers additional range for internal use without increasing cost on 32-bit platforms. Signed-off-by: Keith Packard --- src/attiny/ao_arch.h | 5 +++++ src/kernel/ao.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/attiny') diff --git a/src/attiny/ao_arch.h b/src/attiny/ao_arch.h index dfd41afe..5550eb44 100644 --- a/src/attiny/ao_arch.h +++ b/src/attiny/ao_arch.h @@ -36,6 +36,11 @@ #define AO_LED_TYPE uint8_t +#ifndef AO_TICK_TYPE +#define AO_TICK_TYPE uint16_t +#define AO_TICK_SIGNED int16_t +#endif + /* Various definitions to make GCC look more like SDCC */ #define ao_arch_naked_declare __attribute__((naked)) diff --git a/src/kernel/ao.h b/src/kernel/ao.h index 910c1d8e..c00de1fe 100644 --- a/src/kernel/ao.h +++ b/src/kernel/ao.h @@ -100,8 +100,8 @@ extern AO_ROMCONFIG_SYMBOL uint32_t ao_radio_cal; */ #ifndef AO_TICK_TYPE -#define AO_TICK_TYPE uint16_t -#define AO_TICK_SIGNED int16_t +#define AO_TICK_TYPE uint32_t +#define AO_TICK_SIGNED int32_t #endif extern volatile AO_TICK_TYPE ao_tick_count; -- cgit v1.2.3