Working build

This commit is contained in:
Mark Qvist 2014-12-18 23:45:36 +01:00
parent 4119591f88
commit 35c504703c
10 changed files with 1159 additions and 34 deletions

9
util/constants.h Normal file
View 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

View file

@ -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