Kevin O'Connor 78982ebb51 avr: Implement internal avr specific timer to handle 16bit overflows
Don't rely on the generic scheduler code to always have a timer no
more than 1ms in the future.  Instead, create an avr specific timer
that will be called every 0x8000 ticks.  This simplifies the generic
code and it reduces the amount of code that needs to be run every
millisecond.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-08-08 00:27:28 -04:00

22 lines
502 B
C

#ifndef __GENERIC_MISC_H
#define __GENERIC_MISC_H
#include <stdarg.h> // va_list
#include <stddef.h> // size_t
#include <stdint.h> // uint8_t
struct command_encoder;
void console_sendf(const struct command_encoder *ce, va_list args);
uint32_t timer_from_us(uint32_t us);
uint8_t timer_is_before(uint32_t time1, uint32_t time2);
uint32_t timer_read_time(void);
void timer_kick(void);
void *dynmem_start(void);
void *dynmem_end(void);
uint16_t crc16_ccitt(char *buf, uint8_t len);
#endif // misc.h