Commit 9e6cee086acda19221eec5fd4a463eb88fb073ef
authorAndreas Schultes <andreas.schultes@googlemail.com>
Sat, 1 Jul 2017 20:06:16 +0000 (22:06 +0200)
committerMichel Pollet <github.com@pollet.net>
Wed, 6 Sep 2017 07:17:48 +0000 (08:17 +0100)
simavr/sim/avr_timer.c

index e1e1397dc39ca2458a0e6922a4e69961376505a4..fede329aff0bc9d6d88da03c3362f511c26af20f 100644 (file)
@@ -498,13 +498,13 @@ avr_timer_configure(
                                                __FUNCTION__, p->name, top, 'A'+compi, ocr);
                        }
                }
-               if (ocr && ocr <= top) {
+               if (ocr <= top) {
                        p->comp[compi].comp_cycles = comp_cycles;
 
                        if (p->trace & (avr_timer_trace_compa << compi)) printf(
                                        "TIMER: %s-%c %c %.2fHz = %d cycles\n",
                                        __FUNCTION__, p->name,
-                                       'A'+compi, resulting_clock / ocr,
+                                       'A'+compi, resulting_clock / (ocr+1),
                                        (int)comp_cycles);
                }
        }