forked RemoteIR
Fork of RemoteIR by
Revision 5:e158c85c55ff, committed 2010-08-21
- Comitter:
- shintamainjp
- Date:
- Sat Aug 21 11:02:58 2010 +0000
- Parent:
- 4:2304646f6ff5
- Child:
- 6:e57504fc802e
- Commit message:
Changed in this revision
ReceiverIR.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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]; }