-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add basic Charlieplexing scan #10
Conversation
src/leddrv.c
Outdated
@@ -3,46 +3,61 @@ | |||
#define LED_DRIVE_STRENTH GPIO_ModeOut_PP_20mA | |||
#define LED_PINCOUNT (23) | |||
|
|||
#define PA_BASE ((uint32_t *)0x400010A0) |
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 know if we are going to access non 4 bytes aligned offsets, but in that case, it will deref the wrong address
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.
There is no access to non 4 bytes aligned offsets. But I've just found pre-defined base address in the StdPeriphDriver; I'll use that instead.
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 see you just changed the code, so I guess you understood the issue with gpio_base being already uint32_t aligned
*(uint32_t *)(gpio_base + GPIO_PD_DRV) = *cfg;
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 had a workaround for that before the last change:
uint32_t b = (uint32_t)gpio_base; // <--here
*(uint32_t *)(b + GPIO_PD_DRV) = *cfg;
It seems kind of ugly but I changed to use pre-defined base address in the last change anyway.
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.
that is not matching coding style and unneeded
Did you mean commit 817425b? It seem nonsense but for quick testing. I'll remove it here and add changing brightness feature in another PR. How do you think? |
Makefile changes |
|
What coding style do you suggest? |
I see many projects use the old style, but isn't it convenient to have this appending style? It could be
|
@fcartegnie if there is no other change I think it is time to get this PR merge. |
You can't merge do & undos or fixs to those commits. Please rebase -i and discard reverted and reverter code, and merge intra fix changes |
Then force push or should I make a new PR? |
use the force, luke |
generated project from EVT
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.
unsure why we need to commit so much code / project template
I could write a script to automatically download and generate |
Please keep StdPeriphDriver in the repository. I believe it would be a bad idea to have our repository depend on Code pulled in at build-time from an external source. That creates a dependency we don't want. (admittedly I don't like the StdPeriphDriver code. I believe at some point we might want to fix/modify it. It is inconsistent within itself and has some stupid design descisions. Being able to fix it is an important reason to keep the code in our repository.) |
Hey, I just finished some basic initial code for the project.
There are some problems with the interrupt when using xpack's
riscv-none-elf-gcc
:Switching back to
riscv-none-embed-gcc
seems working, but the timer interrupt handler takes so much time that the main loop doesn't have enough time slice to execute.Main changes: