Merge #1284
1284: Fix APB clock calculation for several STM32 families r=Dirbaio a=ericyanush This PR fixes #1283 Co-authored-by: Eric Yanush <eric@yanu.sh>
This commit is contained in:
commit
f9c0c53e12
@ -313,7 +313,7 @@ pub(crate) unsafe fn init(config: Config) {
|
||||
pre => {
|
||||
let pre: Ppre = pre.into();
|
||||
let pre: u8 = 1 << (pre.0 - 3);
|
||||
let freq = ahb_freq / (1 << (pre as u8 - 3));
|
||||
let freq = ahb_freq / pre as u32;
|
||||
(freq, freq * 2)
|
||||
}
|
||||
};
|
||||
|
@ -314,7 +314,7 @@ pub(crate) unsafe fn init(config: Config) {
|
||||
pre => {
|
||||
let pre: Ppre = pre.into();
|
||||
let pre: u8 = 1 << (pre.0 - 3);
|
||||
let freq = ahb_freq / (1 << (pre as u8 - 3));
|
||||
let freq = ahb_freq / pre as u32;
|
||||
(freq, freq * 2)
|
||||
}
|
||||
};
|
||||
|
@ -483,7 +483,7 @@ pub(crate) unsafe fn init(config: Config) {
|
||||
pre => {
|
||||
let pre: Ppre = pre.into();
|
||||
let pre: u8 = 1 << (pre.0 - 3);
|
||||
let freq = ahb_freq / (1 << (pre as u8 - 3));
|
||||
let freq = ahb_freq / pre as u32;
|
||||
(freq, freq * 2)
|
||||
}
|
||||
};
|
||||
|
@ -481,7 +481,7 @@ pub(crate) unsafe fn init(config: Config) {
|
||||
pre => {
|
||||
let pre: Ppre = pre.into();
|
||||
let pre: u8 = 1 << (pre.0 - 3);
|
||||
let freq = ahb_freq / (1 << (pre as u8 - 3));
|
||||
let freq = ahb_freq / pre as u32;
|
||||
(freq, freq * 2)
|
||||
}
|
||||
};
|
||||
|
@ -481,7 +481,7 @@ pub(crate) unsafe fn init(config: Config) {
|
||||
pre => {
|
||||
let pre: u8 = pre.into();
|
||||
let pre: u8 = 1 << (pre - 3);
|
||||
let freq = ahb_freq / (1 << (pre as u8 - 3));
|
||||
let freq = ahb_freq / pre as u32;
|
||||
(freq, freq * 2)
|
||||
}
|
||||
};
|
||||
@ -491,7 +491,7 @@ pub(crate) unsafe fn init(config: Config) {
|
||||
pre => {
|
||||
let pre: u8 = pre.into();
|
||||
let pre: u8 = 1 << (pre - 3);
|
||||
let freq = ahb_freq / (1 << (pre as u8 - 3));
|
||||
let freq = ahb_freq / pre as u32;
|
||||
(freq, freq * 2)
|
||||
}
|
||||
};
|
||||
|
@ -151,7 +151,7 @@ pub(crate) unsafe fn init(config: Config) {
|
||||
pre => {
|
||||
let pre: u8 = pre.into();
|
||||
let pre: u8 = 1 << (pre - 3);
|
||||
let freq = ahb_freq / (1 << (pre as u8 - 3));
|
||||
let freq = ahb_freq / pre as u32;
|
||||
(freq, freq * 2)
|
||||
}
|
||||
};
|
||||
|
@ -240,7 +240,7 @@ pub(crate) unsafe fn init(config: Config) {
|
||||
pre => {
|
||||
let pre: u8 = pre.into();
|
||||
let pre: u8 = 1 << (pre - 3);
|
||||
let freq = ahb_freq / (1 << (pre as u8 - 3));
|
||||
let freq = ahb_freq / pre as u32;
|
||||
(freq, freq * 2)
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user