-
Notifications
You must be signed in to change notification settings - Fork 311
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
Signaling - LED and Multi Color Led Refactor #48
Open
stevenj
wants to merge
19
commits into
microsoft:master
Choose a base branch
from
stevenj:Signaling
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Same code size, more readable.
Add macro for updating PINMUX.
Make more detailed debug information targeting gdb
also gives compile time checks on legal values
Use a structure for timing information, allows space savings. signal_tick is just the SysTick_Handler now, saves code space assign structures, and not individual values, saves code space use an array of settings, and just look it up, saves A LOT of code space Replace old LED ON macro with new signal macro, during init. Initialise the signal state by calling the new signal_state function.
@dhalbert would you be willing to take a look? |
Sure, happy to test. I'll try it on Adafruit boards, and I have an Arduino Zero. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My Target doesn't have any leds. It has a buzzer. So i added code to drive the buzzer, instead of a LED. But in the process I found the existing LED/Multi Color LED code is quite difficult to discern and is spread all over the place. So I refactored it, and created a new signal module to manage signalling. It can handle the RGB Leds, single flashing leds and also a piezo buzzer on a TCC. I am still testing this code, so this pull request is for review and comment before I finish it.
However, its a lot simpler than the old code, and a lot more flexible. It allows different pulse streams on leds and buzzers to be easily added for different status indications, without using much code. In fact, i built every target using this new signal handling and they are all smaller than before, sometimes significantly smaller:
I haven't got any of these boards, so if anyone would like to help me test the various configurations (the two RGB leds that are defined, and M4 boards, and boards with single leds) I would really appreciate it.
Also, the flash timings at the moment are arbitrary, so if anyone has a better scheme to suggest for on/off times for various states, let me know.