Skip to content

Commit 018955c

Browse files
committed
Disable error trapping for mbed 2 builds
To maintain backwards compatibility keep error trapping turned off for mbed 2 builds.
1 parent 64c6214 commit 018955c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platform/mbed_retarget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsign
296296
#endif
297297
int n; // n is the number of bytes written
298298

299-
#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED
299+
#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED && defined(MBED_CONF_RTOS_PRESENT)
300300
if (core_util_is_isr_active() || !core_util_are_interrupts_enabled()) {
301301
error("Error - writing to a file in an ISR or critical section\r\n");
302302
}
@@ -346,7 +346,7 @@ extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int
346346
#endif
347347
int n; // n is the number of bytes read
348348

349-
#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED
349+
#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED && defined(MBED_CONF_RTOS_PRESENT)
350350
if (core_util_is_isr_active() || !core_util_are_interrupts_enabled()) {
351351
error("Error - reading from a file in an ISR or critical section\r\n");
352352
}

0 commit comments

Comments
 (0)