36 #define SYSTICK_HZ 1250
39 #define PIOS_RTC_MAX_CALLBACKS 3
42 void (*
fn)(uintptr_t);
53 static volatile uint32_t systick_cnt;
55 static
void PIOS_DELAY_Systick_Handler(
void)
72 SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK);
96 uint32_t expires = initial + us;
99 if (initial > expires) {
uint32_t PIOS_DELAY_DiffuS(uint32_t raw)
Subtract raw time from now and convert to us.
uint32_t PIOS_DELAY_GetuS()
Query the Delay timer for the current uS.
Main PiOS header to include all the compiled in PiOS options.
bool PIOS_RTC_RegisterTickCallback(void(*fn)(uintptr_t id), uintptr_t data)
struct msp_ident __attribute((packed))
uint32_t PIOS_DELAY_DiffuS2(uint32_t raw, uint32_t baseline)
Subrtact two raw times and convert to us.
uint32_t PIOS_DELAY_GetuSSince(uint32_t t)
Calculate time in microseconds since a previous time.
int32_t PIOS_DELAY_Init(void)
uint8_t data[XFER_BYTES_PER_PACKET]
static struct rtc_callback_entry rtc_callback_list[PIOS_RTC_MAX_CALLBACKS]
static void PIOS_DELAY_Systick_Handler(void)
float PIOS_RTC_MsPerTick()
static void PIOS_RTC_Tick()
#define PIOS_RTC_MAX_CALLBACKS
#define PIOS_Assert(test)
int32_t PIOS_DELAY_WaitmS(uint32_t mS)
int32_t PIOS_DELAY_WaituS(uint32_t uS)
uint32_t PIOS_DELAY_GetRaw()
Get the raw delay timer, useful for timing.