-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathros_timer.h
More file actions
35 lines (27 loc) 路 729 Bytes
/
Copy pathros_timer.h
File metadata and controls
35 lines (27 loc) 路 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __ROS_TIMER_H__
#define __ROS_TIMER_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "ros_port.h"
// uncompleted define
typedef struct ros_tcb ROS_TCB;
typedef uint8_t status_t;
typedef struct ros_timer {
ROS_TCB *blocked_tcb;
uint32_t ticks;
struct ros_timer *next_timer;
} ROS_TIMER;
void ros_check_timer();
// add the timer to timer queue
status_t ros_register_timer(ROS_TIMER *timer);
status_t ros_delay(uint32_t ticks);
void ros_set_sys_tick(uint32_t ticks);
uint32_t ros_get_sys_tick();
// transfer system tick to the time in the real world in 24-hours format
status_t ros_set_time(uint8_t hour, uint8_t minute, uint8_t second);
char* ros_get_time();
#ifdef __cplusplus
}
#endif
#endif //__ROS_H__