Skip to content

Commit

Permalink
fix enum name
Browse files Browse the repository at this point in the history
  • Loading branch information
liamkinne committed Aug 3, 2024
1 parent f8b6ff8 commit 2ba7c0f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/flash_with_rtic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mod app {
let mut pll_config = stm32g4xx_hal::rcc::PllConfig::default();

// Sysclock is based on PLL_R
pll_config.mux = stm32g4xx_hal::rcc::PLLSrc::HSI; // 16MHz
pll_config.mux = stm32g4xx_hal::rcc::PllSrc::HSI; // 16MHz
pll_config.n = stm32g4xx_hal::rcc::PllNMul::MUL_32;
pll_config.m = stm32g4xx_hal::rcc::PllMDiv::DIV_2; // f(vco) = 16MHz*32/2 = 256MHz
pll_config.r = Some(stm32g4xx_hal::rcc::PllRDiv::DIV_2); // f(sysclock) = 256MHz/2 = 128MHz
Expand Down
6 changes: 3 additions & 3 deletions src/rcc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub enum LSCOSrc {

/// PLL clock input source
#[derive(Clone, Copy)]
pub enum PLLSrc {
pub enum PllSrc {
HSI,
HSE(Hertz),
HSE_BYPASS(Hertz),
Expand Down Expand Up @@ -304,7 +304,7 @@ impl PllNMul {
/// PLL config
#[derive(Clone, Copy)]
pub struct PllConfig {
pub mux: PLLSrc,
pub mux: PllSrc,
pub m: PllMDiv,
pub n: PllNMul,
pub r: Option<PllRDiv>,
Expand All @@ -315,7 +315,7 @@ pub struct PllConfig {
impl Default for PllConfig {
fn default() -> PllConfig {
PllConfig {
mux: PLLSrc::HSI,
mux: PllSrc::HSI,
m: PllMDiv::DIV_2,
n: PllNMul::MUL_8,
r: Some(PllRDiv::DIV_2),
Expand Down
6 changes: 3 additions & 3 deletions src/rcc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,15 @@ impl Rcc {

// Enable the input clock feeding the PLL
let (pll_input_freq, pll_src_bits) = match pll_cfg.mux {
PLLSrc::HSI => {
PllSrc::HSI => {
self.enable_hsi();
(HSI_FREQ, 0b10)
}
PLLSrc::HSE(freq) => {
PllSrc::HSE(freq) => {
self.enable_hse(false);
(freq.raw(), 0b11)
}
PLLSrc::HSE_BYPASS(freq) => {
PllSrc::HSE_BYPASS(freq) => {
self.enable_hse(true);
(freq.raw(), 0b11)
}
Expand Down

0 comments on commit 2ba7c0f

Please sign in to comment.