Commit 31daee70 authored by Daniel Kampert's avatar Daniel Kampert 👷

Fix wrong values for switch statement in 'SysClock_GetClockPer'

parent ea3cf4de
......@@ -39,7 +39,7 @@ uint32_t SysClock_GetClockPer(void)
if(CLKCTRL.MCLKCTRLB & CLKCTRL_PEN_bm)
{
uint8_t Prescaler = ((CLKCTRL.MCLKCTRLB >> 0x01) & 0x0F) + 0x01;
uint8_t Prescaler = CLKCTRL.MCLKCTRLB & 0x1E;
if(Prescaler > 0x06)
{
switch(Prescaler)
......@@ -73,7 +73,7 @@ uint32_t SysClock_GetClockPer(void)
}
else
{
return SysClock >> Prescaler;
return SysClock >> (Prescaler + 0x01);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment