mirror of
https://github.com/markqvist/OpenModem.git
synced 2025-05-06 16:35:09 -04:00
LED driver work
This commit is contained in:
parent
33f90df998
commit
fa1d89d0e3
3 changed files with 9 additions and 9 deletions
12
util/time.h
12
util/time.h
|
@ -6,13 +6,13 @@
|
|||
|
||||
#define DIV_ROUND(dividend, divisor) (((dividend) + (divisor) / 2) / (divisor))
|
||||
|
||||
typedef int32_t ticks_t;
|
||||
typedef int32_t mtime_t;
|
||||
//typedef int32_t ticks_t;
|
||||
//typedef int32_t mtime_t;
|
||||
|
||||
volatile ticks_t _clock;
|
||||
volatile uint32_t _clock;
|
||||
|
||||
static inline ticks_t timer_clock(void) {
|
||||
ticks_t result;
|
||||
static inline uint32_t timer_clock(void) {
|
||||
uint32_t result;
|
||||
|
||||
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
|
||||
result = _clock;
|
||||
|
@ -22,7 +22,7 @@ static inline ticks_t timer_clock(void) {
|
|||
}
|
||||
|
||||
|
||||
inline ticks_t ms_to_ticks(mtime_t ms) {
|
||||
inline uint32_t ms_to_ticks(mtime_t ms) {
|
||||
return ms * DIV_ROUND(CLOCK_TICKS_PER_SEC, 1000);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue