Skip to content

Commit

Permalink
Disable PS2 reception when power supply is off (maybe not necessary)
Browse files Browse the repository at this point in the history
This was added as I saw some strange incomming bytes when doing ctrl-alt-
delete. They were gone after this and the previous change, not sure which
commit fixed the problem.
  • Loading branch information
stople committed May 26, 2024
1 parent c8ca540 commit 16acb64
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ps2.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@ class PS2KeyboardPort : public PS2Port<clkPin, datPin, size>
Processes a scan code byte received from the keyboard
*/
void processByteReceived(uint8_t value) {

// Power off: Do not add anything to buffer
if (PWR_ON_active() == false) return;

// Handle BAT success (0xaa) or fail (0xfc) code
if (!keyboardIsReady() && (value == 0xaa || value == 0xfc)) {
bat = value;
Expand Down

0 comments on commit 16acb64

Please sign in to comment.