File tree Expand file tree Collapse file tree 3 files changed +5
-182
lines changed
targets/TARGET_Infineon/TARGET_XMC4XXX/VirtualSerial Expand file tree Collapse file tree 3 files changed +5
-182
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 20
20
#include " VirtualSerial.h"
21
21
22
22
/* ***************************************************************** Globals **/
23
- static RingBuff <int16_t , 1024 > ringBuf;
23
+ static CircularBuffer <int16_t , 1024 > ringBuf;
24
24
25
25
/* *************************************************************** Functions **/
26
26
@@ -35,7 +35,7 @@ static void usb_vcom_task() {
35
35
36
36
/* Check if new message is available */
37
37
while (CDC_Device_BytesReceived (&VirtualSerial_CDC_Interface)){
38
- ringBuf.add (CDC_Device_ReceiveByte (&VirtualSerial_CDC_Interface));
38
+ ringBuf.push (CDC_Device_ReceiveByte (&VirtualSerial_CDC_Interface));
39
39
}
40
40
}
41
41
}
@@ -77,9 +77,9 @@ int USBSerial::_getc() {
77
77
int16_t val = 0 ;
78
78
79
79
// wait until character is available
80
- while (ringBuf.isEmpty ());
80
+ while (ringBuf.empty ());
81
81
// get & remove character from ring buffer
82
- ringBuf.pull (& val);
82
+ ringBuf.pop ( val);
83
83
return val;
84
84
}
85
85
@@ -103,7 +103,7 @@ int USBSerial::writable(void){
103
103
*/
104
104
int USBSerial::readable (void ){
105
105
106
- if (!ringBuf.isEmpty ()){
106
+ if (!ringBuf.empty ()){
107
107
return 1 ;
108
108
}
109
109
return 0 ;
Original file line number Diff line number Diff line change 17
17
#ifndef USBSERIAL_H_
18
18
#define USBSERIAL_H_
19
19
20
- #include " RingBuff.h"
21
20
#include " mbed.h"
22
21
#include " rtos.h"
23
22
#include " Stream.h"
You can’t perform that action at this time.
0 commit comments