diff options
author | Akos Kiss <akiss@inf.u-szeged.hu> | 2020-11-16 11:54:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-16 11:54:01 +0100 |
commit | 81702ff5eaf2c047ee00559be3205fae3eaa2c76 (patch) | |
tree | 0fc98032b20ccf0b4a82aeb5862065a2e0f4ac0a /targets | |
parent | c57938e0c706f8602bd82a17044556eb9fb4627c (diff) |
Drop the minimal variant of the default port implementation (#4331)
The minimal variant became quite meaningless lately. There were two
port APIs originally that had extra functions in the default port
in addition to the core-mandated implementations: the I/O and
Termination port APIs. However, the extra Termination API code was
removed a year ago, leaving some minimal extension in the I/O port
only. As the overhead of the extension is negligible, it is not
worth maintaining two library variants.
Therefore
- this commit removes the minimal variant of the default port lib,
- rewrites uses of the minimal variant to use the variant with the
I/O extension, and
- updates targets where I/O port code was copy-n-pasted.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Diffstat (limited to 'targets')
-rw-r--r-- | targets/esp-idf/io.c | 27 | ||||
-rw-r--r-- | targets/riot-stm32f4/Makefile | 2 | ||||
-rw-r--r-- | targets/riot-stm32f4/Makefile.riot | 4 |
3 files changed, 6 insertions, 27 deletions
diff --git a/targets/esp-idf/io.c b/targets/esp-idf/io.c index fab28abe..8dff90b2 100644 --- a/targets/esp-idf/io.c +++ b/targets/esp-idf/io.c @@ -25,34 +25,26 @@ static const char TAG[] = "JS"; static esp_log_level_t crosslog(jerry_log_level_t level) { - switch(level) + switch(level) { case JERRY_LOG_LEVEL_ERROR: return ESP_LOG_ERROR; case JERRY_LOG_LEVEL_WARNING: return ESP_LOG_WARN; case JERRY_LOG_LEVEL_DEBUG: return ESP_LOG_DEBUG; case JERRY_LOG_LEVEL_TRACE: return ESP_LOG_VERBOSE; } - + return ESP_LOG_NONE; } -#ifndef DISABLE_EXTRA_API - /** * Actual log level */ static jerry_log_level_t jerry_port_default_log_level = JERRY_LOG_LEVEL_ERROR; -#define JERRY_PORT_DEFAULT_LOG_LEVEL jerry_port_default_log_level - /** * Get the log level * * @return current log level - * - * Note: - * This function is only available if the port implementation library is - * compiled without the DISABLE_EXTRA_API macro. */ jerry_log_level_t jerry_port_default_get_log_level (void) @@ -62,10 +54,6 @@ jerry_port_default_get_log_level (void) /** * Set the log level - * - * Note: - * This function is only available if the port implementation library is - * compiled without the DISABLE_EXTRA_API macro. */ void jerry_port_default_set_log_level (jerry_log_level_t level) /**< log level */ @@ -73,10 +61,6 @@ jerry_port_default_set_log_level (jerry_log_level_t level) /**< log level */ jerry_port_default_log_level = level; } /* jerry_port_default_set_log_level */ -#else /* DISABLE_EXTRA_API */ -#define JERRY_PORT_DEFAULT_LOG_LEVEL JERRY_LOG_LEVEL_ERROR -#endif /* !DISABLE_EXTRA_API */ - /** * Default implementation of jerry_port_log. Prints log message to the standard * error with 'vfprintf' if message log level is less than or equal to the @@ -84,18 +68,13 @@ jerry_port_default_set_log_level (jerry_log_level_t level) /**< log level */ * * If debugger support is enabled, printing happens first to an in-memory buffer, * which is then sent both to the standard error and to the debugger client. - * - * Note: - * Changing the log level from JERRY_LOG_LEVEL_ERROR is only possible if - * the port implementation library is compiled without the - * DISABLE_EXTRA_API macro. */ void jerry_port_log (jerry_log_level_t level, /**< message log level */ const char *format, /**< format string */ ...) /**< parameters */ { - if (level <= JERRY_PORT_DEFAULT_LOG_LEVEL) + if (level <= jerry_port_default_log_level) { va_list args; va_start (args, format); diff --git a/targets/riot-stm32f4/Makefile b/targets/riot-stm32f4/Makefile index 2cd9631e..5e49ae11 100644 --- a/targets/riot-stm32f4/Makefile +++ b/targets/riot-stm32f4/Makefile @@ -42,7 +42,7 @@ USEMODULE += shell USEMODULE += shell_commands # Add the jerry libs -USEMODULE += libjerry-core libjerry-port-default-minimal libjerry-ext +USEMODULE += libjerry-core libjerry-port-default libjerry-ext include $(RIOTBASE)/Makefile.include diff --git a/targets/riot-stm32f4/Makefile.riot b/targets/riot-stm32f4/Makefile.riot index b30ffc53..1f03ff3f 100644 --- a/targets/riot-stm32f4/Makefile.riot +++ b/targets/riot-stm32f4/Makefile.riot @@ -52,11 +52,11 @@ libjerry: -DJERRY_PROFILE="es5.1" \ -DEXTERNAL_COMPILE_FLAGS="$(EXT_CFLAGS)" \ -DJERRY_GLOBAL_HEAP_SIZE=$(JERRYHEAP) - make -C$(BUILD_DIR) jerry-core jerry-port-default-minimal jerry-ext + make -C$(BUILD_DIR) jerry-core jerry-port-default jerry-ext mkdir -p $(COPYTARGET) cp $(BUILD_DIR)/lib/libjerry-core.a $(COPYTARGET) - cp $(BUILD_DIR)/lib/libjerry-port-default-minimal.a $(COPYTARGET) + cp $(BUILD_DIR)/lib/libjerry-port-default.a $(COPYTARGET) cp $(BUILD_DIR)/lib/libjerry-ext.a $(COPYTARGET) riot-jerry: libjerry |