Skip to content

Mbed-os compile without DEVICE_SERIAL #11086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#ifndef GREENTEA_SERIAL_H
#define GREENTEA_SERIAL_H

#if DEVICE_SERIAL

#include "RawSerial.h"
#include "SingletonPtr.h"

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

/** @}*/
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "greentea-client/greentea_serial.h"

#if DEVICE_SERIAL

/**
* Macros for setting console flow control.
*/
Expand All @@ -21,3 +23,5 @@ GreenteaSerial::GreenteaSerial() : mbed::RawSerial(USBTX, USBRX, MBED_CONF_PLATF
set_flow_control(SerialBase::RTSCTS, STDIO_UART_RTS, STDIO_UART_CTS);
#endif
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

#if DEVICE_SERIAL

#include <ctype.h>
#include <cstdio>
#include <string.h>
Expand Down Expand Up @@ -780,3 +782,5 @@ static int HandleKV(char *out_key,
getNextToken(0, 0);
return 0;
}

#endif
6 changes: 5 additions & 1 deletion features/frameworks/utest/source/unity_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
#include "utest/utest_harness.h"
#include "utest/utest_stack_trace.h"
#include "utest/unity_handler.h"

#if DEVICE_SERIAL
#include "greentea-client/greentea_serial.h"
#endif

void utest_unity_assert_failure(void)
{
Expand All @@ -33,9 +36,10 @@ void utest_unity_ignore_failure(void)
utest::v1::Harness::raise_failure(utest::v1::failure_reason_t(utest::v1::REASON_ASSERTION | utest::v1::REASON_IGNORE));
}

#if DEVICE_SERIAL
void utest_safe_putc(int chr)
{
greentea_serial->putc(chr);
}

#endif

4 changes: 4 additions & 0 deletions features/frameworks/utest/source/utest_default_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
****************************************************************************
*/

#if DEVICE_SERIAL

#include "utest/utest_default_handlers.h"
#include "utest/utest_case.h"
#include "utest/utest_stack_trace.h"
Expand Down Expand Up @@ -102,3 +104,5 @@ utest::v1::status_t utest::v1::verbose_case_failure_handler(const Case *const /*
if (failure.reason & REASON_IGNORE) return STATUS_IGNORE;
return STATUS_CONTINUE;
}

#endif
4 changes: 4 additions & 0 deletions features/frameworks/utest/utest/utest_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
****************************************************************************
*/

#if DEVICE_SERIAL

#ifndef UTEST_SERIAL_H
#define UTEST_SERIAL_H

Expand All @@ -29,3 +31,5 @@
#endif // UTEST_SERIAL_H

/** @}*/

#endif