Skip to content

Commit

Permalink
CHANGELOG.md format fix, remove Option::unwraps() and unwrap manually…
Browse files Browse the repository at this point in the history
…, as unwrap() now introduces impossible-to-display strings that didn't exist w/ approx-July 16 nightly.
  • Loading branch information
cr1901 committed Jan 29, 2018
1 parent 492285f commit b6e2992
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ crates to automate work I did manually.
functionality, and thus removed.
- Commented out code cleaned up (mostly no-longer relevant code).

## [1.0.0] -
## [1.0.0]
### Added
- Pause/Break handling logic implemented, which must be handled specially.
- First fully functional firmware. This initial release depends on very few
Expand Down
11 changes: 9 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ fn porta_handler(mut r: PORT1::Resources) {
if full {
r.KEYBOARD_PINS.at_inhibit(r.PORT_1_2); // Ask keyboard to not send anything while processing keycode.

r.IN_BUFFER.put(r.KEY_IN.take().unwrap());
match r.KEY_IN.take() {
Some(k) => { r.IN_BUFFER.put(k); },
None => { abort(); },
}

r.KEY_IN.clear();

r.KEYBOARD_PINS.at_idle(r.PORT_1_2);
Expand Down Expand Up @@ -228,7 +232,10 @@ fn idle(mut r: idle::Resources) -> ! {
ProcReply::KeyboardReset
} else {
let mut bits_in = rtfm::atomic(|cs|{
r.IN_BUFFER.borrow_mut(cs).take().unwrap()
match r.IN_BUFFER.borrow_mut(cs).take() {
Some(k) => { k },
None => { abort(); },
}
});

bits_in = bits_in & !(0x4000 + 0x0001); // Mask out start/stop bit.
Expand Down

0 comments on commit b6e2992

Please sign in to comment.