Closed
Description
The documentation of crate::rcc::Clocks
claims:
The existence of this value indicates that the clock configuration can no longer be changed
But the following example code can be used to obtain a value of crate::rcc::Clocks
without actually tying the clocks down:
#![no_std]
#![no_main]
use panic_halt as _;
use stm32f1xx_hal as hal;
use cortex_m_rt::entry;
#[entry]
fn main() -> ! {
let clocks: hal::rcc::Clocks = hal::rcc::Config{
hse: Some(8000000),
pllmul: Some(8),
hpre: hal::rcc::HPre::DIV1,
ppre1: hal::rcc::PPre::DIV2,
ppre2: hal::rcc::PPre::DIV1,
adcpre: hal::rcc::AdcPre::DIV8,
usbpre: hal::rcc::UsbPre::DIV1,
}.get_clocks();
loop{}
}
Metadata
Metadata
Assignees
Labels
No labels