MCPcopy Create free account
hub / github.com/DISTORTEC/distortos / switchSystemClock

Function switchSystemClock

source/chip/STM32/STM32F1/STM32F1-RCC.cpp:234–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232#endif // defined(DISTORTOS_CHIP_STM32F105) || defined(DISTORTOS_CHIP_STM32F107)
233
234void switchSystemClock(const SystemClockSource source)
235{
236 const auto sourceValue = static_cast<uint32_t>(source);
237 RCC->CFGR = (RCC->CFGR & ~RCC_CFGR_SW) | sourceValue << RCC_CFGR_SW_Pos;
238 while ((RCC->CFGR & RCC_CFGR_SWS) != sourceValue << RCC_CFGR_SWS_Pos);
239}
240
241} // namespace chip
242

Callers 1

chipLowLevelInitializerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected