Skip to content

Commit

Permalink
fix(sysctl): missing peripheral enable call
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Jun 30, 2024
1 parent 638d3d4 commit 73b285c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/i2c/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ impl<'d> I2c<'d, Blocking> {
w.set_ps(true);
});

T::add_resource_group(0);
{
use crate::sysctl::*;
T::set_clock(ClockConfig::new(ClockMux::CLK_24M, 1));
Expand Down
2 changes: 1 addition & 1 deletion src/sysctl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub(crate) trait SealedClockPeripheral {
clocks().get_clock_freq(Self::SYSCTL_CLOCK)
}

fn add_resource_group(&self, group: usize) {
fn add_resource_group(group: usize) {
if Self::SYSCTL_RESOURCE == usize::MAX {
return;
}
Expand Down
2 changes: 2 additions & 0 deletions src/uart/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ impl<'d> Uart<'d, Blocking> {
) -> Result<Self, ConfigError> {
into_ref!(rx, tx);

T::add_resource_group(0);

rx.set_as_alt(rx.alt_num());
tx.set_as_alt(tx.alt_num());

Expand Down

0 comments on commit 73b285c

Please sign in to comment.