60 #include <avr/pgmspace.h>
61 #include <avr/interrupt.h>
66 typedef uint16_t SystemRTCType;
69 #define SYSTEM_MILLISECONDS_TO_RTC_CYCLES(x) \
70 ( (uint16_t) ( (double) F_RTC * x / 1E3 + 0.5) )
72 #define SYSTEM_TICK_FREQ 10
73 #define SYSTEM_TICK_MS (1000/SYSTEM_TICK_FREQ)
75 void SystemInit(
void);
76 void SystemReset(
void);
77 void SystemEnterBootloader(
void);
78 void SystemStartUSBClock(
void);
79 void SystemStopUSBClock(
void);
80 void SystemInterruptInit(
void);
81 INLINE
bool SystemTick100ms(
void);
82 INLINE SystemRTCType SystemGetRTC(
void);
85 INLINE SystemRTCType SystemGetRTC(
void)
90 INLINE
bool SystemTick100ms(
void)
92 if (TCE0.INTFLAGS & TC0_OVFIF_bm) {
93 TCE0.INTFLAGS = TC0_OVFIF_bm;