From 22171d8301e1b4e337d0f0f567a44c70bf961c1f Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Sat, 11 Jun 2022 09:48:03 +0200 Subject: [PATCH] ESP32 compile fixes --- ESP32/console_esp32.cpp | 2 +- ESP32/log.cpp | 1 + ESP32/log.h | 1 + log.cpp | 9 +++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) create mode 120000 ESP32/log.cpp create mode 120000 ESP32/log.h diff --git a/ESP32/console_esp32.cpp b/ESP32/console_esp32.cpp index df20bc1..5765d05 100644 --- a/ESP32/console_esp32.cpp +++ b/ESP32/console_esp32.cpp @@ -102,7 +102,7 @@ void console_esp32::panel_update_thread() int run_mode = current_PSW >> 14; uint16_t current_PC = c->getPC(); - uint32_t full_addr = b->calculate_physical_address(run_mode, current_PC, false, false); + uint32_t full_addr = b->calculate_physical_address(run_mode, current_PC, false, false, true); uint16_t current_instr = b->readWord(current_PC); diff --git a/ESP32/log.cpp b/ESP32/log.cpp new file mode 120000 index 0000000..acdcf24 --- /dev/null +++ b/ESP32/log.cpp @@ -0,0 +1 @@ +../log.cpp \ No newline at end of file diff --git a/ESP32/log.h b/ESP32/log.h new file mode 120000 index 0000000..49a04dd --- /dev/null +++ b/ESP32/log.h @@ -0,0 +1 @@ +../log.h \ No newline at end of file diff --git a/log.cpp b/log.cpp index 5dc66cd..4a49664 100644 --- a/log.cpp +++ b/log.cpp @@ -16,6 +16,13 @@ static FILE *lfh = nullptr; static int lf_uid = -1; static int lf_gid = -1; +#if defined(ESP32) +int gettid() +{ + return 0; +} +#endif + void setlog(const char *lf, const log_level_t ll_file, const log_level_t ll_screen) { if (lfh) @@ -52,11 +59,13 @@ void dolog(const log_level_t ll, const char *fmt, ...) if (!lfh) error_exit(true, "Cannot access log-file %s", logfile); +#if !defined(ESP32) if (lf_uid != -1 && fchown(fileno(lfh), lf_uid, lf_gid) == -1) error_exit(true, "Cannot change logfile (%s) ownership", logfile); if (fcntl(fileno(lfh), F_SETFD, FD_CLOEXEC) == -1) error_exit(true, "fcntl(FD_CLOEXEC) failed"); +#endif } uint64_t now = get_us();