-
Notifications
You must be signed in to change notification settings - Fork 23
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
Feature/qingke v4 delay #28
Conversation
src/lib.rs
Outdated
@@ -47,7 +47,7 @@ mod interrupt_ext; | |||
|
|||
pub use crate::_generated::{peripherals, Peripherals}; | |||
|
|||
#[cfg(any(systick_rv2, systick_rv3))] | |||
#[cfg(any(systick_rv2, systick_rv3, systick_rv4))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better make it not(time-driver-systick)
. time-driver-systick
is not added yet.
You can leave the remaining fix to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand where systick_rv4
comes from.
And time-driver-systick
does not exist so the condition will always be true, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And time-driver-systick does not exist so the condition will always be true, right?
Yes. I'll add the required cfg flags in build.rs
.
systick_rv4 comes from the following(generated via build.rs
):
And
Lines 76 to 82 in 56de16c
// Add peripheral cfg flags on the fly | |
for p in METADATA.peripherals { | |
if let Some(r) = &p.registers { | |
println!("cargo:rustc-cfg={}", r.kind); | |
println!("cargo:rustc-cfg={}_{}", r.kind, r.version); | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks
qingke v4 SysTick timer is 64-bit while qingke v2 is 32-bit but the registers have the same names
1f44c73
to
154a660
Compare
cab5245
to
f531587
Compare
CI build is fixed by rebase. |
To close #27 I have looked at the QingKeV4 Microprocessor Manual and the register names are the same for the QingKeV2 and QingKeV4 except than on QingKeV2 the Systick timer is 32-bit and on the QingKeV4 it is a 64-bit timer.
But given the implementation, we reset the timer to 0 for each delay and
delay_ns()
takes au32
so I had the same implementation for both processors, hence the use of the same file.I have also included a basic example without embassy. I have renamed the blinky using embassy
embassy_blinky
to use theembassy_
prefix as done inesp-hal
examples. Let me know if you are ok with this. I can rename the other examples for more consistency.Note that according to the issue #6 I had to make these changes to run the examples: