if (ocr && ocr <= top) {
p->comp[compi].comp_cycles = frequency / fc; // avr_hz_to_cycles(p->io.avr, fa);
- if (p->trace_flags & (1 << compi))
+ if (p->trace_flags /*& (1 << compi)*/)
printf("%s-%c %c %.2fHz = %d cycles\n", __FUNCTION__, p->name,
'A'+compi, fc, (int)p->comp[compi].comp_cycles);
}
break;
}
uint16_t otrace = p->trace_flags;
+
if (target != -1) {
p->trace_flags = 1 << target;
} else {
avr_timer_reconfigure(p);
break;
case avr_timer_wgm_fc_pwm: // OCR is not used here
+ avr_timer_reconfigure(p);
break;
case avr_timer_wgm_ctc:
avr_timer_reconfigure(p);
}
break;
case avr_timer_wgm_fast_pwm:
+ if (target != -1)
+ avr_timer_reconfigure(p);
avr_raise_irq(p->io.irq + TIMER_IRQ_OUT_PWM0, _timer_get_ocr(p, AVR_TIMER_COMPA));
avr_raise_irq(p->io.irq + TIMER_IRQ_OUT_PWM1, _timer_get_ocr(p, AVR_TIMER_COMPB));
break;