mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 03:58:33 +08:00
rename get_time_ms to get_time_ms64 (fix issue #241)
This commit is contained in:
parent
038d690c72
commit
6143fed4d1
@ -1,6 +1,7 @@
|
||||
# 最新动态
|
||||
* 2019/10/07
|
||||
* 增加ostream\_buffered。
|
||||
* 按issue 241,把get\_time\_ms改名为get\_time\_ms64。
|
||||
|
||||
* 2019/10/06
|
||||
* 增加ring buffer。
|
||||
|
@ -85,7 +85,7 @@ static ret_t date_time_get_now_impl(date_time_t* dt) {
|
||||
uint64_t stm_now_ms();
|
||||
void stm_time_init(void);
|
||||
|
||||
uint64_t get_time_ms() {
|
||||
uint64_t get_time_ms64() {
|
||||
#if 0
|
||||
/*
|
||||
struct timeval tv;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* File: sys_tick.c
|
||||
* Author: AWTK Develop Team
|
||||
* Brief: use sys tick to implement sleep/get_time_ms.
|
||||
* Brief: use sys tick to implement sleep/get_time_ms64.
|
||||
*
|
||||
* Copyright (c) 2018 - 2019 Guangzhou ZHIYUAN Electronics Co.,Ltd.
|
||||
*
|
||||
@ -27,15 +27,15 @@ void SysTick_Handler(void) {
|
||||
g_sys_tick++;
|
||||
}
|
||||
|
||||
uint64_t get_time_ms() {
|
||||
uint64_t get_time_ms64() {
|
||||
return g_sys_tick;
|
||||
}
|
||||
|
||||
void sleep_ms(uint32_t ms) {
|
||||
uint32_t count = 0;
|
||||
uint64_t start = get_time_ms();
|
||||
uint64_t start = get_time_ms64();
|
||||
|
||||
while (get_time_ms() < (start + ms)) {
|
||||
while (get_time_ms64() < (start + ms)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
uint64_t get_time_ms(void);
|
||||
uint64_t get_time_ms64(void);
|
||||
void sleep_ms(uint32_t ms);
|
||||
|
||||
ret_t platform_prepare(void);
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
uint64_t time_now_ms(void) {
|
||||
static uint64_t last = 0;
|
||||
uint64_t now = get_time_ms();
|
||||
uint64_t now = get_time_ms64();
|
||||
|
||||
if (now < last) {
|
||||
if (now < 0xffffffff) {
|
||||
@ -38,5 +38,5 @@ uint64_t time_now_ms(void) {
|
||||
}
|
||||
|
||||
uint64_t time_now_s(void) {
|
||||
return get_time_ms() / 1000;
|
||||
return get_time_ms64() / 1000;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user