Skip to content

Commit 6ce2439

Browse files
author
Seppo Takalo
authored
Merge pull request #11086 from Tharazi97/Greentea_compile_without_serial
Mbed-os compile without DEVICE_SERIAL
2 parents c5c7458 + 4c13c46 commit 6ce2439

File tree

6 files changed

+24
-1
lines changed

6 files changed

+24
-1
lines changed

features/frameworks/greentea-client/greentea-client/greentea_serial.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#ifndef GREENTEA_SERIAL_H
55
#define GREENTEA_SERIAL_H
66

7+
#if DEVICE_SERIAL
8+
79
#include "RawSerial.h"
810
#include "SingletonPtr.h"
911

@@ -16,3 +18,4 @@ extern SingletonPtr<GreenteaSerial> greentea_serial;
1618
#endif
1719

1820
/** @}*/
21+
#endif

features/frameworks/greentea-client/source/greentea_serial.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "greentea-client/greentea_serial.h"
22

3+
#if DEVICE_SERIAL
4+
35
/**
46
* Macros for setting console flow control.
57
*/
@@ -21,3 +23,5 @@ GreenteaSerial::GreenteaSerial() : mbed::RawSerial(USBTX, USBRX, MBED_CONF_PLATF
2123
set_flow_control(SerialBase::RTSCTS, STDIO_UART_RTS, STDIO_UART_CTS);
2224
#endif
2325
}
26+
27+
#endif

features/frameworks/greentea-client/source/greentea_test_env.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* limitations under the License.
1616
*/
1717

18+
#if DEVICE_SERIAL
19+
1820
#include <ctype.h>
1921
#include <cstdio>
2022
#include <string.h>
@@ -780,3 +782,5 @@ static int HandleKV(char *out_key,
780782
getNextToken(0, 0);
781783
return 0;
782784
}
785+
786+
#endif

features/frameworks/utest/source/unity_handler.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
#include "utest/utest_harness.h"
2020
#include "utest/utest_stack_trace.h"
2121
#include "utest/unity_handler.h"
22+
23+
#if DEVICE_SERIAL
2224
#include "greentea-client/greentea_serial.h"
25+
#endif
2326

2427
void utest_unity_assert_failure(void)
2528
{
@@ -33,9 +36,10 @@ void utest_unity_ignore_failure(void)
3336
utest::v1::Harness::raise_failure(utest::v1::failure_reason_t(utest::v1::REASON_ASSERTION | utest::v1::REASON_IGNORE));
3437
}
3538

39+
#if DEVICE_SERIAL
3640
void utest_safe_putc(int chr)
3741
{
3842
greentea_serial->putc(chr);
3943
}
40-
44+
#endif
4145

features/frameworks/utest/source/utest_default_handlers.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
****************************************************************************
1717
*/
1818

19+
#if DEVICE_SERIAL
20+
1921
#include "utest/utest_default_handlers.h"
2022
#include "utest/utest_case.h"
2123
#include "utest/utest_stack_trace.h"
@@ -102,3 +104,5 @@ utest::v1::status_t utest::v1::verbose_case_failure_handler(const Case *const /*
102104
if (failure.reason & REASON_IGNORE) return STATUS_IGNORE;
103105
return STATUS_CONTINUE;
104106
}
107+
108+
#endif

features/frameworks/utest/utest/utest_serial.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
****************************************************************************
2020
*/
2121

22+
#if DEVICE_SERIAL
23+
2224
#ifndef UTEST_SERIAL_H
2325
#define UTEST_SERIAL_H
2426

@@ -29,3 +31,5 @@
2931
#endif // UTEST_SERIAL_H
3032

3133
/** @}*/
34+
35+
#endif

0 commit comments

Comments
 (0)