#ifndef FUNCGEN_CALIBRATION_H_ #define FUNCGEN_CALIBRATION_H_ /**************************************************************************** * Microcontroller CPU speed calibration * ****************************************************************************/ /* 1ms timer calibration */ #define DELAY_1MS_TIMERFREQ (1 << CS01) /* == F_CPU/8 */ #define DELAY_1MS_LOOP 80 #define DELAY_1MS_LOOP_TIMES 25 /* 1us delayloop calibration */ #define DELAY_1US_LOOP 4 /* The hardware jiffies counter runs at F_CPU/1024. * The software jiffies counter is incremented on every 8-bit overflow * of the hardware counter. So the JIFFIES_PER_SECOND is calculated by: * 1000000 / (((1 / (F_CPU / 1024)) * 1000000) * 256) */ #define JIFFIES_PER_SECOND 61 /* 61.03515625 */ #endif /* FUNCGEN_CALIBRATION_H_ */