Skip to content

Commit 7611513

Browse files
Merge pull request #4506 from c1728p9/disable_2_error_trapping
Disable error trapping for mbed 2 builds
2 parents f55a8c3 + 018955c commit 7611513

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
@@ -277,7 +277,7 @@ extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsign
277277
#endif
278278
int n; // n is the number of bytes written
279279

280-
#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED
280+
#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED && defined(MBED_CONF_RTOS_PRESENT)
281281
if (core_util_is_isr_active() || !core_util_are_interrupts_enabled()) {
282282
error("Error - writing to a file in an ISR or critical section\r\n");
283283
}
@@ -327,7 +327,7 @@ extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int
327327
#endif
328328
int n; // n is the number of bytes read
329329

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

0 commit comments

Comments
 (0)