Ring Buffer reconciled with RTOS. If with using RTOS, this lib is enabled Mutex. Default RingBuffer size is 256 Bytes, Max size is 1024 Bytes.

Dependents:   RN41 HC05 HC05 mySerial ... more

Revision:
2:db4675083c8c
Parent:
1:8f2a3144902b
Child:
3:dced590a2d1b
--- a/RingBuffer.cpp	Fri Oct 30 06:34:07 2015 +0000
+++ b/RingBuffer.cpp	Mon Nov 02 06:59:10 2015 +0000
@@ -37,6 +37,9 @@
     if((idxR == idxF) && !_empty)    // R==F: empty or full
         return true;    // means FULL
 
+    if(chr == NULL)
+        return false;
+
 // mutex for RTOS
 #ifdef RTOS_H
     mutex.lock();