E8WATS
Fork of RemoteIR by
Diff: ReceiverIR.cpp
- Revision:
- 4:2304646f6ff5
- Parent:
- 3:dfed23b157e6
- Child:
- 5:e158c85c55ff
diff -r dfed23b157e6 -r 2304646f6ff5 ReceiverIR.cpp --- a/ReceiverIR.cpp Sat Aug 21 04:46:14 2010 +0000 +++ b/ReceiverIR.cpp Sat Aug 21 11:01:31 2010 +0000 @@ -33,12 +33,10 @@ return s; } -int ReceiverIR::getData(RemoteIR::Format *format, uint8_t *buf, int bufsiz) { +int ReceiverIR::getData(RemoteIR::Format *format, uint8_t *buf, int bitlength) { IRQ_DISABLE(); - const int bitcount = data.bitcount; - const int n = bitcount / 8 + (((bitcount % 8) != 0) ? 1 : 0); - if (bufsiz < n) { + if (bitlength < data.bitcount) { IRQ_ENABLE(); return -1; }