X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fkernel%2Fao.h;h=2bd0e3673d47701eb12565566260aeeb48eb5780;hb=master;hp=9ca2c60eac711c94734d199eca9603ac98ec5169;hpb=f51316c02a8385223567e1aa8e3f5a0b74c16cd6;p=fw%2Faltos diff --git a/src/kernel/ao.h b/src/kernel/ao.h index 9ca2c60e..0437cb07 100644 --- a/src/kernel/ao.h +++ b/src/kernel/ao.h @@ -19,10 +19,11 @@ #ifndef _AO_H_ #define _AO_H_ -#include +#include #include #include #include +#include #include #include #include @@ -40,6 +41,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 @@ -113,6 +119,7 @@ extern volatile AO_TICK_TYPE ao_tick_count; #endif #define AO_MS_TO_TICKS(ms) ((ms) / (1000 / AO_HERTZ)) #define AO_SEC_TO_TICKS(s) ((AO_TICK_TYPE) (s) * AO_HERTZ) +#define AO_NS_TO_TICKS(ns) ((ns) / (1000000000L / AO_HERTZ)) /* Returns the current time in ticks */ AO_TICK_TYPE @@ -390,6 +397,7 @@ ao_spi_slave(void); extern uint8_t ao_gps_new; extern AO_TICK_TYPE ao_gps_tick; +extern AO_TICK_TYPE ao_gps_utc_tick; extern uint8_t ao_gps_mutex; extern struct ao_telemetry_location ao_gps_data; extern struct ao_telemetry_satellite ao_gps_tracking_data;