X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/c830fcb0e1d42c1300ebe78a8b33924054b63a87..05fcf7e2a79bebb978d4aeaef26b12f70c6826f8:/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c?ds=sidebyside diff --git a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c index 386058426..1d8a06eea 100644 --- a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c @@ -37,7 +37,7 @@ #include "KeyboardHost.h" /** Main program entry point. This routine configures the hardware required by the application, then - * starts the scheduler to run the application tasks. + * enters a loop to run the application tasks in sequence. */ int main(void) { @@ -161,13 +161,13 @@ void ReadNextReport(void) char PressedKey = 0; /* Retrieve pressed key character if alphanumeric */ - if ((KeyboardReport.KeyCode >= 0x04) && (KeyboardReport.KeyCode <= 0x1D)) - PressedKey = (KeyboardReport.KeyCode - 0x04) + 'A'; - else if ((KeyboardReport.KeyCode >= 0x1E) && (KeyboardReport.KeyCode <= 0x27)) - PressedKey = (KeyboardReport.KeyCode - 0x1E) + '0'; - else if (KeyboardReport.KeyCode == 0x2C) + if ((KeyboardReport.KeyCode[0] >= 0x04) && (KeyboardReport.KeyCode[0] <= 0x1D)) + PressedKey = (KeyboardReport.KeyCode[0] - 0x04) + 'A'; + else if ((KeyboardReport.KeyCode[0] >= 0x1E) && (KeyboardReport.KeyCode[0] <= 0x27)) + PressedKey = (KeyboardReport.KeyCode[0] - 0x1E) + '0'; + else if (KeyboardReport.KeyCode[0] == 0x2C) PressedKey = ' '; - else if (KeyboardReport.KeyCode == 0x28) + else if (KeyboardReport.KeyCode[0] == 0x28) PressedKey = '\n'; /* Print the pressed key character out through the serial port if valid */