Skip to content

Commit 5bd013d

Browse files
committed
core: update HardwareSerial driver for SIM868
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent a570373 commit 5bd013d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

cores/logicrom/HardwareSerial.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@
1414
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
1515
HardwareSerial Serial(UART0);
1616
HardwareSerial Serial1(UART1);
17+
#ifndef PLATFORM_SIM868
1718
HardwareSerial Serial2(UART2);
18-
#if defined(SOC_RDA8910) || defined(PLATFORM_S20U) || defined(PLATFORM_M56)
19+
#endif
20+
#if defined(SOC_RDA8910) || defined(PLATFORM_MC20U) || defined(PLATFORM_SIM868) || defined(PLATFORM_M56)
1921
HardwareSerial USBSerial(USBUART);
2022
#endif
2123
HardwareSerial BTSerial(BTSPPHOST);
2224
#endif
2325

2426
void serialEvent() __attribute__((weak));
2527
void serialEvent1() __attribute__((weak));
28+
#ifndef PLATFORM_SIM868
2629
void serialEvent2() __attribute__((weak));
27-
#if defined(SOC_RDA8910) || defined(PLATFORM_S20U) || defined(PLATFORM_M56)
30+
#endif
31+
#if defined(SOC_RDA8910) || defined(PLATFORM_MC20U) || defined(PLATFORM_SIM868) || defined(PLATFORM_M56)
2832
void usbSerialEvent() __attribute__((weak));
2933
#endif
3034
void btSerialEvent() __attribute__((weak));
@@ -37,10 +41,12 @@ void serialEventRun(void)
3741
if (serialEvent1 && Serial1.available())
3842
serialEvent1();
3943

44+
#ifndef PLATFORM_SIM868
4045
if (serialEvent2 && Serial2.available())
4146
serialEvent2();
47+
#endif
4248

43-
#if defined(SOC_RDA8910) || defined(PLATFORM_S20U) || defined(PLATFORM_M56)
49+
#if defined(SOC_RDA8910) || defined(PLATFORM_MC20U) || defined(PLATFORM_SIM868) || defined(PLATFORM_M56)
4450
if (usbSerialEvent && USBSerial.available())
4551
usbSerialEvent();
4652
#endif

cores/logicrom/HardwareSerial.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
#define UART0 "/dev/ttyS0"
2626
#define UART1 "/dev/ttyS1"
27+
#ifndef PLATFORM_SIM868
2728
#define UART2 "/dev/ttyS2"
29+
#endif
2830
#define USBUART "/dev/ttyUSB0"
2931
#define BTSPPHOST "/dev/bthost0"
3032

@@ -91,7 +93,9 @@ class HardwareSerial: public Stream {
9193
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
9294
extern HardwareSerial Serial;
9395
extern HardwareSerial Serial1;
96+
#ifndef PLATFORM_SIM868
9497
extern HardwareSerial Serial2;
98+
#endif
9599
extern HardwareSerial USBSerial;
96100
extern HardwareSerial BTSerial;
97101
#endif

0 commit comments

Comments
 (0)