implemented new keyboard model: Sun Type 5

This commit is contained in:
2008-11-01 21:20:07 +00:00
parent cc61962875
commit 43c5c297e8
5 changed files with 313 additions and 9 deletions

View File

@ -44,6 +44,7 @@
#define JUMPER2 PD7 ///< address for jumper 2
uint8_t curmatrix[16]; ///< contains current state of the keyboard
uint8_t oldmatrix[16]; ///< contains old state of the keyboard
uint8_t ghostmatrix[16]; ///< contains pressed keys that belong to a ghost-key situation
void hardwareInit(void) {
@ -105,12 +106,6 @@ void printMatrix(void) {
sendString("---");
}
#define LED_NUM 0x01 ///< num LED on a boot-protocol keyboard
#define LED_CAPS 0x02 ///< caps LED on a boot-protocol keyboard
#define LED_SCROLL 0x04 ///< scroll LED on a boot-protocol keyboard
#define LED_COMPOSE 0x08 ///< compose LED on a boot-protocol keyboard
#define LED_KANA 0x10 ///< kana LED on a boot-protocol keyboard
void setLeds(uint8_t LEDstate) {
if (LEDstate & LED_NUM) { // light up caps lock
PORTLEDS &= ~(1 << LEDNUM);
@ -258,6 +253,12 @@ uint8_t scankeys(uint8_t* reportBuffer, uint8_t* oldReportBuffer, uint8_t sizeOf
debounce--;
}
if (debounce == 1) {
/*
if (memcmp(oldmatrix, curmatrix, sizeof(curmatrix)) != 0) {
printMatrix();
memcpy(oldmatrix, curmatrix, sizeof(curmatrix));
}
*/
// debounce counter expired, create report
uint8_t reportIndex = 2; // reportBuffer[0] contains modifiers
memset(reportBuffer, 0, sizeOfReportBuffer); // clear report buffer