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

boards/common: add common timer config for GD32VF103 boards #19205

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Jan 27, 2023

Contribution description

Turns out this is still needed.

Testing procedure

Flash examples/blinky with this patch:

diff --git a/examples/blinky/Makefile b/examples/blinky/Makefile
index 2d58be2d6b..c25a66db48 100644
--- a/examples/blinky/Makefile
+++ b/examples/blinky/Makefile
@@ -16,6 +16,7 @@ DEVELHELP ?= 1
 QUIET ?= 1
 
 # Use a peripheral timer for the delay, if available
+USEMODULE += ztimer_msec
 FEATURES_OPTIONAL += periph_timer
 
 include $(RIOTBASE)/Makefile.include
diff --git a/examples/blinky/main.c b/examples/blinky/main.c
index ac90ccbc15..23486e1c58 100644
--- a/examples/blinky/main.c
+++ b/examples/blinky/main.c
@@ -29,7 +29,7 @@
 static void delay(void)
 {
     if (IS_USED(MODULE_ZTIMER)) {
-        ztimer_sleep(ZTIMER_USEC, 1 * US_PER_SEC);
+        ztimer_sleep(ZTIMER_MSEC, 1 * MS_PER_SEC);
     }
     else {
         /*
on master this will get you very erratic LED behavior
Video.mp4
With this patch 1s intervals are achieved
IMG_0381.MOV

Issues/PRs references

@github-actions github-actions bot added the Area: boards Area: Board ports label Jan 27, 2023
@benpicco benpicco added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: boards Area: Board ports and removed Area: boards Area: Board ports labels Jan 27, 2023
@riot-ci
Copy link

riot-ci commented Jan 27, 2023

Murdock results

✔️ PASSED

162d06a boards/common: add common timer config for GD32VF103 boards

Success Failures Total Runtime
6796 0 6796 07m:37s

Artifacts

@benpicco benpicco force-pushed the boards/sipeed-longan_common branch from a8118b8 to 25ecb84 Compare January 27, 2023 20:29
@benpicco benpicco force-pushed the boards/sipeed-longan_common branch from 25ecb84 to 162d06a Compare January 27, 2023 20:39
@kfessel
Copy link
Contributor

kfessel commented Jan 27, 2023

GD32VF103 does not provide a 32 Bit capable timer, that could be used for ztimer_usec or xtimer -> XTIMER_WIDTH must be defined.

(RTC would be 32 Bit)

@benpicco
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented Jan 27, 2023

Build succeeded:

@bors bors bot merged commit c6c84cc into RIOT-OS:master Jan 27, 2023
@benpicco benpicco deleted the boards/sipeed-longan_common branch January 27, 2023 22:52
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.04 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants