2020-09-26 13:50:55 +00:00
|
|
|
|
/******************************************************************************
|
|
|
|
|
* @brief atģ<EFBFBD><EFBFBD>OS<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֲ<EFBFBD>ӿ<EFBFBD>
|
|
|
|
|
*
|
2020-12-04 12:54:26 +00:00
|
|
|
|
* Copyright (c) 2020, <morro_luo@163.com>
|
2020-09-26 13:50:55 +00:00
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*
|
|
|
|
|
* Change Logs:
|
|
|
|
|
* Date Author Notes
|
|
|
|
|
* 2020-01-02 Morro <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef _ATUTIL_H_
|
|
|
|
|
#define _ATUTIL_H_
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stdbool.h>
|
2021-01-05 14:31:48 +00:00
|
|
|
|
#include <stddef.h>
|
2020-09-26 13:50:55 +00:00
|
|
|
|
|
2021-01-05 14:31:48 +00:00
|
|
|
|
typedef void *at_sem_t; /*<2A>ź<EFBFBD><C5BA><EFBFBD>*/
|
2020-09-26 13:50:55 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ǰϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
static inline unsigned int at_get_ms(void)
|
|
|
|
|
{
|
2021-01-05 14:31:48 +00:00
|
|
|
|
/*Add here...*/
|
|
|
|
|
return 0;
|
2020-09-26 13:50:55 +00:00
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ʱ<EFBFBD>ж<EFBFBD>
|
|
|
|
|
* @retval true | false
|
|
|
|
|
*/
|
|
|
|
|
static inline bool at_istimeout(unsigned int start_time, unsigned int timeout)
|
|
|
|
|
{
|
|
|
|
|
return at_get_ms() - start_time > timeout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* @retval none
|
|
|
|
|
*/
|
|
|
|
|
static inline void at_delay(uint32_t ms)
|
|
|
|
|
{
|
2021-01-05 14:31:48 +00:00
|
|
|
|
|
2020-09-26 13:50:55 +00:00
|
|
|
|
}
|
|
|
|
|
/*
|
2021-01-05 14:31:48 +00:00
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>
|
2020-09-26 13:50:55 +00:00
|
|
|
|
* @retval none
|
|
|
|
|
*/
|
2021-01-05 14:31:48 +00:00
|
|
|
|
static inline at_sem_t at_sem_new(int value)
|
2020-09-26 13:50:55 +00:00
|
|
|
|
{
|
2021-01-05 14:31:48 +00:00
|
|
|
|
return NULL;
|
2020-09-26 13:50:55 +00:00
|
|
|
|
}
|
|
|
|
|
/*
|
2021-01-05 14:31:48 +00:00
|
|
|
|
* @brief <EFBFBD>ȴ<EFBFBD><EFBFBD>ź<EFBFBD>
|
2020-09-26 13:50:55 +00:00
|
|
|
|
* @retval none
|
|
|
|
|
*/
|
2021-01-05 14:31:48 +00:00
|
|
|
|
static inline bool at_sem_wait(at_sem_t s, uint32_t timeout)
|
2020-09-26 13:50:55 +00:00
|
|
|
|
{
|
2021-01-05 14:31:48 +00:00
|
|
|
|
return false;
|
2020-09-26 13:50:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
2021-01-05 14:31:48 +00:00
|
|
|
|
* @brief <EFBFBD>ͷ<EFBFBD><EFBFBD>ź<EFBFBD>
|
2020-09-26 13:50:55 +00:00
|
|
|
|
* @retval none
|
|
|
|
|
*/
|
2021-01-05 14:31:48 +00:00
|
|
|
|
static inline void at_sem_post(at_sem_t s)
|
2020-09-26 13:50:55 +00:00
|
|
|
|
{
|
2021-01-05 14:31:48 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD>ٵ<EFBFBD><EFBFBD>ź<EFBFBD>
|
|
|
|
|
* @retval none
|
|
|
|
|
*/
|
|
|
|
|
static inline void at_sem_free(at_sem_t s)
|
|
|
|
|
{
|
|
|
|
|
|
2020-09-26 13:50:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|