Skip to content

Commit

Permalink
getMaxPeriod output seconds instead of µs
Browse files Browse the repository at this point in the history
  • Loading branch information
lunOptics committed Aug 2, 2020
1 parent dc22a01 commit f9f8c6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Teensy/GPT/GPTChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace TeensyTimerTool

float GptChannel::getMaxPeriod()
{
uint32_t pid_clock_mhz = (CCM_CSCMR1 & CCM_CSCMR1_PERCLK_CLK_SEL) ? 24 : (F_BUS_ACTUAL / 1000000);
float pid_clock_mhz = (CCM_CSCMR1 & CCM_CSCMR1_PERCLK_CLK_SEL) ? 24E6f : (F_BUS_ACTUAL);
return (float)0xFFFF'FFFE / pid_clock_mhz;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Teensy/PIT4/PITChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ namespace TeensyTimerTool

float PITChannel::getMaxPeriod()
{
return (float)0xFFFF'FFFE / clockFactor;
return (float)0xFFFF'FFFE / clockFactor / 1'000'000;
}


Expand Down
2 changes: 1 addition & 1 deletion src/Teensy/TMR/TMRChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace TeensyTimerTool

float TMRChannel::getMaxPeriod()
{
return pscValue / 150.0f * 0xFFFE;
return pscValue / 150'000'000.0f * 0xFFFE;
}

void TMRChannel::_setNextPeriod(const uint16_t cnt)
Expand Down

0 comments on commit f9f8c6f

Please sign in to comment.