Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: ReceiverIR.cpp
- Revision:
- 5:e158c85c55ff
- Parent:
- 4:2304646f6ff5
- Child:
- 6:e57504fc802e
diff -r 2304646f6ff5 -r e158c85c55ff ReceiverIR.cpp
--- a/ReceiverIR.cpp Sat Aug 21 11:01:31 2010 +0000
+++ b/ReceiverIR.cpp Sat Aug 21 11:02:58 2010 +0000
@@ -36,13 +36,14 @@
int ReceiverIR::getData(RemoteIR::Format *format, uint8_t *buf, int bitlength) {
IRQ_DISABLE();
+ const int nbytes = bitcount / 8 + (((bitcount % 8) != 0) ? 1 : 0);
if (bitlength < data.bitcount) {
IRQ_ENABLE();
return -1;
}
*format = data.format;
- for (int i = 0; i < n; i++) {
+ for (int i = 0; i < nbytes; i++) {
buf[i] = data.buffer[i];
}