Skip to content

Commit

Permalink
Merge pull request ARMmbed#174 from Sissors/master
Browse files Browse the repository at this point in the history
Properly round non integer bus-frequencies in MHz
  • Loading branch information
emilmont committed Feb 18, 2014
2 parents 94a1bdc + 65d6645 commit 8583716
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void pit_init(void) {
PIT->CHANNEL[1].TCTRL |= PIT_TCTRL_TEN_MASK; // Start timer 1

// Use channel 0 as a prescaler for channel 1
PIT->CHANNEL[0].LDVAL = bus_frequency() / 1000000 - 1;
PIT->CHANNEL[0].LDVAL = (bus_frequency() + 500000) / 1000000 - 1;
PIT->CHANNEL[0].TCTRL = PIT_TCTRL_TEN_MASK; // Start timer 0, disable interrupts
}

Expand Down

0 comments on commit 8583716

Please sign in to comment.