From 018955c7b28a875c935e218d18d305e085bd327f Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Thu, 8 Jun 2017 15:26:22 -0500 Subject: [PATCH] Disable error trapping for mbed 2 builds To maintain backwards compatibility keep error trapping turned off for mbed 2 builds. --- platform/mbed_retarget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/mbed_retarget.cpp b/platform/mbed_retarget.cpp index e4c2930a6b..ba2c3012f5 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/mbed_retarget.cpp @@ -296,7 +296,7 @@ extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsign #endif int n; // n is the number of bytes written -#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED +#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED && defined(MBED_CONF_RTOS_PRESENT) if (core_util_is_isr_active() || !core_util_are_interrupts_enabled()) { error("Error - writing to a file in an ISR or critical section\r\n"); } @@ -346,7 +346,7 @@ extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int #endif int n; // n is the number of bytes read -#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED +#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED && defined(MBED_CONF_RTOS_PRESENT) if (core_util_is_isr_active() || !core_util_are_interrupts_enabled()) { error("Error - reading from a file in an ISR or critical section\r\n"); }