#include <stdio.h>
#include "avr_timer.h"
#include "avr_ioport.h"
+#include "sim_time.h"
/*
* The timers are /always/ 16 bits here, if the higher byte register
p->tov_cycles = frequency / t; // avr_hz_to_cycles(frequency, t);
- AVR_LOG(p->io.avr, LOG_TRACE, "TIMER: %s-%c TOP %.2fHz = %d cycles\n",
- __FUNCTION__, p->name, t, (int)p->tov_cycles);
+ AVR_LOG(p->io.avr, LOG_TRACE, "TIMER: %s-%c TOP %.2fHz = %d cycles = %dusec\n",
+ __FUNCTION__, p->name, t, (int)p->tov_cycles,
+ (int)avr_cycles_to_usec(p->io.avr, p->tov_cycles));
for (int compi = 0; compi < AVR_TIMER_COMP_COUNT; compi++) {
if (!p->comp[compi].r_ocr)
if (ocr && ocr <= top) {
p->comp[compi].comp_cycles = frequency / fc; // avr_hz_to_cycles(p->io.avr, fa);
- AVR_LOG(p->io.avr, LOG_TRACE, "TIMER: %s-%c %c %.2fHz = %d cycles\n", __FUNCTION__, p->name,
+ AVR_LOG(p->io.avr, LOG_TRACE, "TIMER: %s-%c %c %.2fHz = %d cycles\n",
+ __FUNCTION__, p->name,
'A'+compi, fc, (int)p->comp[compi].comp_cycles);
}
}