-
Notifications
You must be signed in to change notification settings - Fork 108
Refactor #30 #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor #30 #33
Conversation
Looks like an improvement to me, thanks! Maybe remove |
The
This can be done but then requires a bit more awkward cfg feature gating. How about this instead? Doesn't look quite as weird. let msi = match clocks.msi() {
Some(msi) => msi == crate::rcc::MsiFreq::RANGE48M,
None => false,
};
let hsi = clocks.hsi48();
assert!(msi || hsi); |
Fine :) I was mistakenly under the impression that RNG and USB both needed HSI48 on the L432. Not sure what happens if a device without HSI48 configures it to be turned on, plus it's wasting space on those devices, but I guess we can revisit minimalism when we're more feature complete, and the stm32-rs has come to a consensus on how best to organize multi-device HALs anyway. |
@MabezDev Ok I see the stm32-rs/stm32-rs#141 has not been merge yet. If merged #32 should disappear. Do you still want to erfactor that ? Becasue the CRRCR is available on some 4x6 chip. I have double check all reference manual only the 47x does not have the CRRCR. |
I still think that is interesting to have the usb_rng flags. as it is an independent clock line. |
At this point I time I think it's best to feature gate specific chips. e.g 476 475 471 instead of 47x. I also think it would be best to accept feature gate PR's as a full package where all/most peripherals are features gated for the device. I'll try to feature gate a chip at some point as a reference PR for adding more devices. Hopefully we can tick all the items of of this #29 not too far in the future :) |
…ve the hsi, instead we should feature gate devices per chip
It shouldn't be able to turn it on once feature gated properly, the hsi(bool) is hidden. Not sure the byte for hsi matters to much but you are right there is probably a more efficient way to do this. |
Based on the comments from @nickray and my own thoughts:
CRRCR
in modulercc
#32Clocks
, but for stm32l4x6 devices the method to set it is not availableusb_rng
,Clocks
is used to detect if a peripheral has the right clocks or not* seerng.rs
.@mathk this will introduce some breaking changes for you, but nothing too severe I hope.
* The clock selection still needs to be implemented properly.