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

Ion::msleep and LED blinking with Timer + various register definitions #314

Merged
merged 4 commits into from Aug 24, 2018

Conversation

@boricj
Copy link
Contributor

boricj commented Jan 18, 2018

Change Ion::msleep from a CPU busy-loop to a timer busy-loop. Ideally we'd put the MCU to sleep while sleeping to save on power, but we don't handle interrupts yet.

Also adding register definitions for #311 and a bugfix while I'm here.

@boricj boricj force-pushed the boricj:rtc_part1 branch 2 times, most recently from cb7e381 to eba5481 Jan 18, 2018
@boricj boricj changed the title Ion::msleep with Timer and various fixes Ion::msleep/Ion::usleep with Timer and various fixes Jan 21, 2018
@boricj

This comment has been minimized.

Copy link
Contributor Author

boricj commented Jan 21, 2018

I cleaned up the pull request and switched Ion::usleep to use a timer too. Thus this obsoletes #313 with a cleaner solution that does not depend on how fast the CPU processes NOPs.

I won't attempt trying out interrupts without a means to debug the hardware though, so this pull request is done. Power consumption should be identical to the current implementation.

@EmilieNumworks

This comment has been minimized.

Copy link
Collaborator

EmilieNumworks commented Jan 23, 2018

It looks like a very good PR, thank you @boricj ! It is not a good time right now for us to review and merge it as we are close to release a new update. However, if you could split the the first commit (about the Valgrind uninitialised read) from the others, I will merge it right away.

@boricj boricj force-pushed the boricj:rtc_part1 branch 2 times, most recently from aaf404d to e8cccc7 Jan 31, 2018
@boricj

This comment has been minimized.

Copy link
Contributor Author

boricj commented Jan 31, 2018

Turns out setting up a timer for Ion::usleep takes long enough that the screen is significantly late for dimming, so I reverted that.

@boricj boricj changed the title Ion::msleep/Ion::usleep with Timer and various fixes Ion::msleep with Timer and various register definitions Jan 31, 2018
@boricj

This comment has been minimized.

Copy link
Contributor Author

boricj commented Jan 31, 2018

While messing with timers, I've managed to decouple the exam LED blinking from the event loop and enable LED charging status. Activating exam mode makes the LED blink red and inhibits any LED change until it is deactivated.

A side-effect is that the LED will now keep blinking in exam mode while the calculator is shut down or busy (fixing #196). This might draw more power than before in this specific case, but the alternative would be far less pleasant for the student should an exam invigilator notices the lack of proper calculator blinkingness.

@boricj boricj changed the title Ion::msleep with Timer and various register definitions Ion::msleep and LED blinking with Timer + various register definitions Jan 31, 2018
@boricj boricj force-pushed the boricj:rtc_part1 branch 2 times, most recently from 4f0a20f to 4b52456 Feb 2, 2018
boricj added 2 commits Jan 31, 2018
Fixes #34
@boricj boricj force-pushed the boricj:rtc_part1 branch from 4b52456 to 123dc1b Feb 4, 2018
@EmilieNumworks EmilieNumworks merged commit 123dc1b into numworks:master Aug 24, 2018
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.