mirror of https://github.com/ARMmbed/mbed-os.git
Can compile without serial
parent
b9e9ff94a7
commit
200e7055de
|
@ -4,6 +4,8 @@
|
||||||
#ifndef GREENTEA_SERIAL_H
|
#ifndef GREENTEA_SERIAL_H
|
||||||
#define GREENTEA_SERIAL_H
|
#define GREENTEA_SERIAL_H
|
||||||
|
|
||||||
|
#if DEVICE_SERIAL
|
||||||
|
|
||||||
#include "RawSerial.h"
|
#include "RawSerial.h"
|
||||||
#include "SingletonPtr.h"
|
#include "SingletonPtr.h"
|
||||||
|
|
||||||
|
@ -16,3 +18,4 @@ extern SingletonPtr<GreenteaSerial> greentea_serial;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** @}*/
|
/** @}*/
|
||||||
|
#endif
|
|
@ -1,5 +1,7 @@
|
||||||
#include "greentea-client/greentea_serial.h"
|
#include "greentea-client/greentea_serial.h"
|
||||||
|
|
||||||
|
#if DEVICE_SERIAL
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Macros for setting console flow control.
|
* Macros for setting console flow control.
|
||||||
*/
|
*/
|
||||||
|
@ -21,3 +23,5 @@ GreenteaSerial::GreenteaSerial() : mbed::RawSerial(USBTX, USBRX, MBED_CONF_PLATF
|
||||||
set_flow_control(SerialBase::RTSCTS, STDIO_UART_RTS, STDIO_UART_CTS);
|
set_flow_control(SerialBase::RTSCTS, STDIO_UART_RTS, STDIO_UART_CTS);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -15,6 +15,8 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if DEVICE_SERIAL
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -780,3 +782,5 @@ static int HandleKV(char *out_key,
|
||||||
getNextToken(0, 0);
|
getNextToken(0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -19,7 +19,10 @@
|
||||||
#include "utest/utest_harness.h"
|
#include "utest/utest_harness.h"
|
||||||
#include "utest/utest_stack_trace.h"
|
#include "utest/utest_stack_trace.h"
|
||||||
#include "utest/unity_handler.h"
|
#include "utest/unity_handler.h"
|
||||||
|
|
||||||
|
#if DEVICE_SERIAL
|
||||||
#include "greentea-client/greentea_serial.h"
|
#include "greentea-client/greentea_serial.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
void utest_unity_assert_failure(void)
|
void utest_unity_assert_failure(void)
|
||||||
{
|
{
|
||||||
|
@ -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));
|
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)
|
void utest_safe_putc(int chr)
|
||||||
{
|
{
|
||||||
greentea_serial->putc(chr);
|
greentea_serial->putc(chr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if DEVICE_SERIAL
|
||||||
|
|
||||||
#include "utest/utest_default_handlers.h"
|
#include "utest/utest_default_handlers.h"
|
||||||
#include "utest/utest_case.h"
|
#include "utest/utest_case.h"
|
||||||
#include "utest/utest_stack_trace.h"
|
#include "utest/utest_stack_trace.h"
|
||||||
|
@ -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;
|
if (failure.reason & REASON_IGNORE) return STATUS_IGNORE;
|
||||||
return STATUS_CONTINUE;
|
return STATUS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -19,6 +19,8 @@
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if DEVICE_SERIAL
|
||||||
|
|
||||||
#ifndef UTEST_SERIAL_H
|
#ifndef UTEST_SERIAL_H
|
||||||
#define UTEST_SERIAL_H
|
#define UTEST_SERIAL_H
|
||||||
|
|
||||||
|
@ -29,3 +31,5 @@
|
||||||
#endif // UTEST_SERIAL_H
|
#endif // UTEST_SERIAL_H
|
||||||
|
|
||||||
/** @}*/
|
/** @}*/
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue