Skip to content
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

Update examples to initialize sys_clk/uart_clk using clock::Strict #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

9names
Copy link

@9names 9names commented Jan 5, 2021

This is bringing in the minimum amount of changes require for main and examples to work with the new clock code in the HAL.
The UART example needed a few more modifications than the others, since it was using GLB registers to configure UART clk_en and clk_div

@mkroman
Copy link
Collaborator

mkroman commented Jan 8, 2021

I don't think it's great practice to use use some::path::*; outside of the prelude module.

I'd rather have this:

use bl602_hal::clock::{self, SysclkFreq, UART_PLL_FREQ};
use bl602_hal::{pac, prelude::*};

and later:

let clocks = clock::Strict::new()

Also, when running the bl602-serial example I'm no longer getting an output on the TX0 pin.
Something's up with my setup, now I'm not even able to get it to output data with an older revision.

...

Ok, I've confirmed that it's only this change that breaks the output.
I couldn't get output on older revisions before because I had to reset the device for the old code to work again.

@9names
Copy link
Author

9names commented Jan 12, 2021

I've cleaned up the imports as per your suggestion, looks much better.
Any further blockers on getting this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants