aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/HID.cpp
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2011-08-30 11:04:34 -0400
committerZach Eveland <zeveland@blacklabel-development.com>2011-08-30 11:04:34 -0400
commit481fdeab797d449f6b82473b1e377c495224cff7 (patch)
tree2cddbbbc0c6be94842a1e0f5e92e709cfdc8e751 /cores/arduino/HID.cpp
parent351a78e01e8e61f5d1423f30b17f209151fcf79d (diff)
CDC and HID write() routines now return non-void - brought in line with new write behavior
Diffstat (limited to 'cores/arduino/HID.cpp')
-rw-r--r--cores/arduino/HID.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/cores/arduino/HID.cpp b/cores/arduino/HID.cpp
index b042895..36e9b67 100644
--- a/cores/arduino/HID.cpp
+++ b/cores/arduino/HID.cpp
@@ -388,7 +388,7 @@ const uint8_t _asciimap[128] =
};
uint8_t USBPutChar(uint8_t c);
-void Keyboard_::write(uint8_t c)
+size_t Keyboard_::write(uint8_t c)
{
// Keydown
{
@@ -398,10 +398,10 @@ void Keyboard_::write(uint8_t c)
else
{
if (c >= 128)
- return;
+ return 0;
c = pgm_read_byte(_asciimap + c);
if (!c)
- return;
+ return 0;
if (c & 0x80)
{
keys.modifiers |= KEY_MODIFIER_LEFT_SHIFT;
@@ -416,6 +416,7 @@ void Keyboard_::write(uint8_t c)
KeyReport keys = {0};
sendReport(&keys);
}
+ return 1;
}
#endif \ No newline at end of file