Skip to content

Commit 25b17ba

Browse files
committed
cores/xmc: Adapt Serial after using namespace arduino.
Signed-off-by: zhanglinjing <[email protected]>
1 parent b7eb907 commit 25b17ba

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

cores/xmc/Arduino.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "api/deprecated-avr-comp/avr/dtostrf.h"
2828

2929
#ifdef __cplusplus
30+
using namespace arduino;
3031
extern "C" {
3132
#endif
3233

cores/xmc/Uart.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828

2929
// Constructors ////////////////////////////////////////////////////////////////
3030

31-
Uart::Uart(XMC_UART_t *xmc_uart_config,
32-
arduino::RingBuffer *rx_buffer,
33-
arduino::RingBuffer *tx_buffer) {
31+
Uart::Uart(XMC_UART_t *xmc_uart_config, RingBuffer *rx_buffer, RingBuffer *tx_buffer) {
3432
_XMC_UART_config = xmc_uart_config;
3533
_rx_buffer = rx_buffer;
3634
_tx_buffer = tx_buffer;

cores/xmc/Uart.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,10 @@ typedef enum XMC_UART_MODE {
8787
//****************************************************************************
8888
// @Class Definitionsw
8989
//****************************************************************************
90-
class Uart : public arduino::HardwareSerial {
90+
class Uart : public HardwareSerial {
9191
public:
9292
XMC_UART_t *_XMC_UART_config;
93-
94-
Uart(XMC_UART_t *xmc_uart_config,
95-
arduino::RingBuffer *rx_buffer,
96-
arduino::RingBuffer *tx_buffer);
93+
q Uart(XMC_UART_t *xmc_uart_config, RingBuffer *rx_buffer, RingBuffer *tx_buffer);
9794

9895
void begin(unsigned long);
9996
void begin(unsigned long baudrate, uint16_t config) override;
@@ -129,7 +126,7 @@ class Uart : public arduino::HardwareSerial {
129126
void IrqHandler(void);
130127

131128
private:
132-
arduino::RingBuffer *_rx_buffer;
129+
RingBuffer *_rx_buffer;
133130
arduino::RingBuffer *_tx_buffer;
134131
};
135132

cores/xmc/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ int main(void) {
4949
setup();
5050
while (1) {
5151
loop();
52-
serialEventRun();
52+
if (arduino::serialEventRun) {
53+
arduino::serialEventRun();
54+
} else {
55+
::serialEventRun();
56+
}
5357
}
5458
}
5559

0 commit comments

Comments
 (0)