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

Lack elements in struct GPTConfig in the source of HT32's hal_gpt_lld.h #368

Closed
d93921012 opened this issue May 29, 2023 · 2 comments
Closed

Comments

@d93921012
Copy link

d93921012 commented May 29, 2023

When I build my qmk project,I encountered the problem as follows.

Compiling: platforms/chibios/wait.c
platforms/chibios/wait.c: In function 'wait_us':
platforms/chibios/wait.c:24:54: error: excess elements in struct initializer [-Werror]
24 | static const GPTConfig gpt_cfg = {1000000, NULL, 0, 0}; /* 1MHz timer, no callback /
| ^
platforms/chibios/wait.c:24:54: note: (near initialization for 'gpt_cfg')
platforms/chibios/wait.c:24:57: error: excess elements in struct initializer [-Werror]
24 | static const GPTConfig gpt_cfg = {1000000, NULL, 0, 0}; /
1MHz timer, no callback */
| ^
platforms/chibios/wait.c:24:57: note: (near initialization for 'gpt_cfg')
cc1: all warnings being treated as errors
[ERRORS]

Comparing the source hal_gpt_lld.h of HT32 with the one of STM32,the two elements cr2 and dier should be added to the struct GPTConfig.

The source hal_gpt_lld.h of HT32 is in the folder -- "chibios-contrib\os\hal\ports\HT32\LLD\TIMv1".

@dexter93
Copy link
Contributor

dexter93 commented Jun 2, 2023

the two elements are specific to STM32, can't comment on their validity on HT32.

But for your specific issue, that is a QMK nuisance. See how I tackled it on another chip here

-    static const GPTConfig gpt_cfg = {1000000, NULL, 0, 0}; /* 1MHz timer, no callback */
+    static const GPTConfig gpt_cfg = { .frequency = 1000000 }; /* 1MHz timer, no callback */

@d93921012
Copy link
Author

Thank you.

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

No branches or pull requests

2 participants