Fixed bug in sys clock init, also reported by glory (#22)
* Fixed bug in sys clock init, also reported by glory * Removed modification of SN_FLASH->LPCTRL from SystemCoreClockUpdate(). SystemCoreClockUpdate() should only update the SystemCoreClock variable.
This commit is contained in:
parent
82b25f3972
commit
e72cf89dfa
|
@ -129,19 +129,6 @@ void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
|
|||
}
|
||||
|
||||
SystemCoreClock /= AHB_prescaler;
|
||||
|
||||
//;;;;;;;;; Need for SN32F260 Begin
|
||||
if (SystemCoreClock > 24000000)
|
||||
{
|
||||
SN_FLASH->LPCTRL = 0x5AFA0005;
|
||||
}
|
||||
else //SystemCoreClock <= 24000000
|
||||
{
|
||||
SN_FLASH->LPCTRL = 0x5AFA0000;
|
||||
}
|
||||
//;;;;;;;;; Need for SN32F260 End
|
||||
|
||||
//return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -160,7 +147,6 @@ void SystemInit (void)
|
|||
#if SYS0_CLKCFG_VAL == IHRC //IHRC
|
||||
|
||||
#if (AHB_PRESCALAR == 0 | AHB_PRESCALAR == 1)
|
||||
SN_FLASH->LPCTRL = 0x5AFA0004;
|
||||
SN_FLASH->LPCTRL = 0x5AFA0005;
|
||||
#else
|
||||
SN_FLASH->LPCTRL = 0x5AFA0000;
|
||||
|
|
Loading…
Reference in New Issue