fixed usbSendReport() and backslash key

This commit is contained in:
Ronald Schaten 2008-07-12 21:05:24 +00:00
parent db363cc939
commit 35f126ca82

View File

@ -2,7 +2,7 @@
* \file firmware/main.c * \file firmware/main.c
* \brief Main functions for USB-keyboard * \brief Main functions for USB-keyboard
* \author Ronald Schaten <ronald@schatenseite.de> * \author Ronald Schaten <ronald@schatenseite.de>
* \version $Id: main.c,v 1.4 2008/07/11 19:11:37 rschaten Exp $ * \version $Id: main.c,v 1.5 2008/07/12 21:05:24 rschaten Exp $
* *
* License: GNU GPL v2 (see License.txt) * License: GNU GPL v2 (see License.txt)
*/ */
@ -411,10 +411,12 @@ uint8_t usbFunctionWrite(uchar *data, uchar len) {
* \param key key-code * \param key key-code
*/ */
void usbSendReport(uint8_t mode, uint8_t key) { void usbSendReport(uint8_t mode, uint8_t key) {
reportBuffer[0] = mode; // buffer for HID reports. we use a private one, so nobody gets disturbed
reportBuffer[1] = key; uint8_t repBuffer[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
repBuffer[0] = mode;
repBuffer[2] = key;
while (!usbInterruptIsReady()); // wait while (!usbInterruptIsReady()); // wait
usbSetInterrupt(reportBuffer, sizeof(reportBuffer)); // send usbSetInterrupt(repBuffer, sizeof(repBuffer)); // send
} }
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
@ -433,7 +435,7 @@ const uint8_t PROGMEM keymatrix[16][8] = {
{KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved }, // 0 {KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved }, // 0
{KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved }, // 1 {KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved, KEY_Reserved }, // 1
{KEY_ESCAPE, KEY_Tab, KEY_grave, KEY_1, KEY_Q, KEY_A, KEY_Z, KEY_Reserved }, // 2 {KEY_ESCAPE, KEY_Tab, KEY_grave, KEY_1, KEY_Q, KEY_A, KEY_Z, KEY_Reserved }, // 2
{KEY_backslash, KEY_capslock, KEY_F1, KEY_2, KEY_W, KEY_S, KEY_X, KEY_Reserved }, // 3 {KEY_Euro, KEY_capslock, KEY_F1, KEY_2, KEY_W, KEY_S, KEY_X, KEY_Reserved }, // 3
{KEY_F4, KEY_F3, KEY_F2, KEY_3, KEY_E, KEY_D, KEY_C, KEY_Reserved }, // 4 {KEY_F4, KEY_F3, KEY_F2, KEY_3, KEY_E, KEY_D, KEY_C, KEY_Reserved }, // 4
{KEY_G, KEY_T, KEY_5, KEY_4, KEY_R, KEY_F, KEY_V, KEY_B }, // 5 {KEY_G, KEY_T, KEY_5, KEY_4, KEY_R, KEY_F, KEY_V, KEY_B }, // 5
{KEY_F5, KEY_DELETE, KEY_F9, KEY_F10, KEY_Reserved, KEY_Reserved, KEY_Return, KEY_Spacebar }, // 6 {KEY_F5, KEY_DELETE, KEY_F9, KEY_F10, KEY_Reserved, KEY_Reserved, KEY_Return, KEY_Spacebar }, // 6