-
Notifications
You must be signed in to change notification settings - Fork 1
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
Separate clockConfigRead and clockConfigWrite, Add GPIO_TCLKA_TCLKC_SEL #1
Separate clockConfigRead and clockConfigWrite, Add GPIO_TCLKA_TCLKC_SEL #1
Conversation
for (uint8_t i = numberOfClocks - 1; i < numberOfClocks; i--) { | ||
// Extract each 4-bit segment and print as a hexadecimal digit | ||
uint8_t segment = (outputMapValue >> (4 * i)) & 0xF; | ||
printf("%X", segment); |
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.
Can't you just print outputMapValue
as %016X
?
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.
Yeah this was a bit annoying, I tried the followings but none of them worked...
printf("Current clock output map: 0x%016X\r\n", outputMapValue);
printf("Current clock output map: 0x%016lX\r\n", outputMapValue);
printf("Current clock output map: 0x%016llX\r\n", outputMapValue);
printf("Current clock output map: 0x%016" PRIx64 "\r\n", outputMapValue);
Could it be that the micro-controller cannot print long long unsigned integer (64-bit)?
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.
You would have to add printlli
, similar to https://github.com/tiqi-group/openMMC/blob/feature/afck/modules/printf-stdarg.c#L127 (and adapt print
accordingly)
But there is no real reason to use a custom printf implementation.
https://github.com/eyalroz/printf/ would be a better alternative.
At least write a comment why you did this.
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.
Alright, I now added some comments about this and added a TODO for using https://github.com/eyalroz/printf/
Don't you want to include |
Good point, I will add it quickly |
I added and tested it quickly. It works. |
I now added gpio_direction_read and gpio_direction_write CLI functions. They are necessary to dynamically set the GPIO_TCLKA_TCLKC_SEL pin as input in order to disable the low-jitter clock bypass. |
6c0e7a9
to
57a6e19
Compare
No description provided.