PaulStoffregen/TimerOne

cyles not calculated correctly if FCPU > 2000000

holymoly opened this issue · 0 comments

Description

The Cycles calculation in TimerOne.h line 183 does not work if the FCPU is smaller 2MHz.
As this calculation is only for Integers the calculation will end up being 0.
F_CPU / 2000000 != 0,5
F_CPU / 2000000 = 0

Steps To Reproduce Problem

Use an FCPU of 1MHz

Hardware & Software

Arduino IDE 1.8.3
Board is a diy Arduino clone -> https://github.com/casartar/MacherDaachBadgeFirmware

Arduino Sketch

none

Errors or Incorrect Output

If cycles is 0 the interuppt does not work correctly.