mirror of
https://github.com/markqvist/OpenModem.git
synced 2025-05-02 14:36:20 -04:00
Working build
This commit is contained in:
parent
4119591f88
commit
35c504703c
10 changed files with 1159 additions and 34 deletions
9
util/constants.h
Normal file
9
util/constants.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#define PROTOCOL_KISS 0x01
|
||||
#define PROTOCOL_SIMPLE_SERIAL 0x02
|
||||
|
||||
#define m328p 0x01
|
||||
#define m1284p 0x02
|
||||
#define m644p 0x03
|
||||
|
||||
#define REF_3V3 0x01
|
||||
#define REF_5V 0x02
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef UTIL_TIME_H
|
||||
#define UTIL_TIME_H
|
||||
|
||||
#include <util/atomic.h>
|
||||
#include "device.h"
|
||||
|
||||
#define DIV_ROUND(dividend, divisor) (((dividend) + (divisor) / 2) / (divisor))
|
||||
|
@ -30,5 +31,13 @@ inline void cpu_relax(void) {
|
|||
// Do nothing!
|
||||
}
|
||||
|
||||
inline void delay_ms(unsigned long ms) {
|
||||
ticks_t start = timer_clock();
|
||||
unsigned long n_ticks = ms_to_ticks(ms);
|
||||
while (timer_clock() - start < n_ticks) {
|
||||
cpu_relax();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue