Index: firmware/App/Services/CommBuffers.c =================================================================== diff -u -r1bbf9da32e622975efed00b1a7589387a9829440 -ref0b3f0ec00fadc50f95e0db1a6477fb4b076ea1 --- firmware/App/Services/CommBuffers.c (.../CommBuffers.c) (revision 1bbf9da32e622975efed00b1a7589387a9829440) +++ firmware/App/Services/CommBuffers.c (.../CommBuffers.c) (revision ef0b3f0ec00fadc50f95e0db1a6477fb4b076ea1) @@ -105,14 +105,14 @@ { U08 *buffPtr; // buffer destination for added data - // adjust buffer count per this data add (also reserves space to add data before releasing thread protection) - commBufferByteCount[ buffer ][ activeBuffer ] += len; - // release thread protection - _enable_IRQ(); // set destination pointer to end of active buffer data buffPtr = &commBuffers[ buffer ][ activeBuffer ][ currentActiveBufCount ]; // copy source data to destination buffer memcpy( buffPtr, data, len ); + // adjust buffer count per this data add (also reserves space to add data before releasing thread protection) + commBufferByteCount[ buffer ][ activeBuffer ] += len; + // release thread protection + _enable_IRQ(); // data successfully added to buffer result = TRUE; }