target: mbedos5: Allow jerry_port_console and jerry_port_log to be overriden by user code (#1458)

We're building a REPL (as user-space program) on top of mbedos5 target. For this I need to override the jerry_port_console and jerry_port_log functions from the REPL. This commit wraps these functions in an ifndef, so we can define macros to not include these files.

JerryScript-DCO-1.0-Signed-off-by: Jan Jongboom janjongboom@gmail.com
This commit is contained in:
Jan Jongboom
2016-12-12 14:30:49 +07:00
committed by Zoltan Herczeg
parent db05d85a9a
commit 233b885ad8
+4
View File
@@ -22,6 +22,7 @@
#include "us_ticker_api.h" #include "us_ticker_api.h"
#ifndef JSMBED_OVERRIDE_JERRY_PORT_CONSOLE
/** /**
* Provide console message implementation for the engine. * Provide console message implementation for the engine.
*/ */
@@ -39,7 +40,9 @@ jerry_port_console (const char *format, /**< format string */
printf ("\r"); /* add CR for proper display in serial monitors */ printf ("\r"); /* add CR for proper display in serial monitors */
} }
} /* jerry_port_console */ } /* jerry_port_console */
#endif /* JSMBED_OVERRIDE_JERRY_PORT_CONSOLE */
#ifndef JSMBED_OVERRIDE_JERRY_PORT_LOG
/** /**
* Provide log message implementation for the engine. * Provide log message implementation for the engine.
*/ */
@@ -60,6 +63,7 @@ jerry_port_log (jerry_log_level_t level, /**< log level */
printf ("\r"); /* add CR for proper display in serial monitors */ printf ("\r"); /* add CR for proper display in serial monitors */
} }
} /* jerry_port_log */ } /* jerry_port_log */
#endif /* JSMBED_OVERRIDE_JERRY_PORT_LOG */
/** /**
* Implementation of jerry_port_fatal. * Implementation of jerry_port_fatal.