mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 11:29:58 +03:00
Fix clock initialisation on new revision CJMCU boards.
This commit is contained in:
parent
56b8f4d37f
commit
754d0974c5
1 changed files with 5 additions and 0 deletions
|
@ -141,7 +141,12 @@ void SetSysClock(bool overclock)
|
||||||
*RCC_CRH |= (uint32_t)0x8 << (RCC_CFGR_PLLMULL9 >> 16);
|
*RCC_CRH |= (uint32_t)0x8 << (RCC_CFGR_PLLMULL9 >> 16);
|
||||||
GPIOC->ODR &= (uint32_t)~(CAN_MCR_RESET);
|
GPIOC->ODR &= (uint32_t)~(CAN_MCR_RESET);
|
||||||
|
|
||||||
|
#if defined(CJMCU)
|
||||||
|
// On CJMCU new revision boards (Late 2014) bit 15 of GPIOC->IDR is '1'.
|
||||||
|
RCC_CFGR_PLLMUL = RCC_CFGR_PLLMULL9;
|
||||||
|
#else
|
||||||
RCC_CFGR_PLLMUL = GPIOC->IDR & CAN_MCR_RESET ? hse_value = 12000000, RCC_CFGR_PLLMULL6 : RCC_CFGR_PLLMULL9;
|
RCC_CFGR_PLLMUL = GPIOC->IDR & CAN_MCR_RESET ? hse_value = 12000000, RCC_CFGR_PLLMULL6 : RCC_CFGR_PLLMULL9;
|
||||||
|
#endif
|
||||||
switch (clocksrc) {
|
switch (clocksrc) {
|
||||||
case SRC_HSE:
|
case SRC_HSE:
|
||||||
if (overclock) {
|
if (overclock) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue