forked from gary/BCU
2
0
Fork 0
BCU/app/stm32fxxx_boot/kernel/kit_time.h

37 lines
925 B
C

#ifndef _KIT_TIME_H_
#define _KIT_TIME_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <time.h>
#include "kit_core.h"
#include "kit_debug.h"
#ifdef NO_OS
extern uint32_t sys_tick;
#endif
uint32_t kit_time_get_tick(void);
uint32_t kit_time_diff(uint32_t last_tick, uint32_t new_tick);
uint32_t kit_time_diff_by_now(uint32_t last_tick);
uint32_t kit_time_diff_by_now_and_update(uint32_t *last_tick);
void kitTimeTick(void);
void kit_time_dly_us(uint32_t dly);
void kit_time_dly_ms(uint32_t dly);
void kit_time_dly_by_fix_period(uint32_t last_tick,uint16_t period);
KitResult kit_wait_flag(volatile uint32_t *reg, uint32_t flag_bit, int32_t timeout);
struct tm * kit_time_get_date(uint16_t start_year, uint32_t stamp);
uint32_t kit_time_get_stamp(uint16_t start_year, struct tm *time);
KitResult kit_wait_flag(volatile uint32_t *reg, uint32_t flag_bit, int32_t timeout);
#ifdef __cplusplus
}
#endif
#endif