// Setup baud rate
// 16 MHz / ( 16 * Baud ) = UBRR
// Baud <- 0.82020 ms per bit, thus 1000 / 0.82020 = 1219.2
- // Thus baud = 820
+ // Thus baud setting = 820
uint16_t baud = 820; // Max setting of 4095
UBRR1H = (uint8_t)(baud >> 8);
UBRR1L = (uint8_t)baud;
// Initially buffer doesn't need to be cleared (it's empty...)
BufferReadyToClear = 0;
+
+ // Reset the keyboard before scanning, we might be in a wierd state
+ // Note: This should be run asap, but we need the USART setup to run this command on the 8304
+ scan_resetKeyboard();
}
SET_RESET();
}
+// Reset Keyboard
+void scan_resetKeyboard( void )
+{
+ // Reset command for the 8304
+ scan_sendData( 0x92 );
+}
+