Merge branch 'master' into psram
This commit is contained in:
commit
f22af40572
12 changed files with 38 additions and 16 deletions
|
@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.9)
|
|||
|
||||
add_compile_options(-Wall -pedantic -Wextra)
|
||||
|
||||
#add_compile_options(-fsanitize=address)
|
||||
#add_link_options(-fsanitize=address)
|
||||
#add_compile_options(-fsanitize=undefined)
|
||||
#add_link_options(-fsanitize=undefined)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
|
|
@ -72,7 +72,6 @@ void console_esp32::panel_update_thread()
|
|||
pixels.begin();
|
||||
|
||||
pixels.clear();
|
||||
|
||||
pixels.show();
|
||||
|
||||
constexpr uint8_t brightness = 16;
|
||||
|
@ -103,7 +102,7 @@ void console_esp32::panel_update_thread()
|
|||
pixels.clear();
|
||||
pixels.show();
|
||||
|
||||
for(;;) {
|
||||
while(!stop_panel) {
|
||||
vTaskDelay(20 / portTICK_PERIOD_MS);
|
||||
|
||||
try {
|
||||
|
@ -141,5 +140,10 @@ void console_esp32::panel_update_thread()
|
|||
put_string_lf("Unknown exception in panel thread");
|
||||
}
|
||||
}
|
||||
|
||||
pixels.clear();
|
||||
pixels.show();
|
||||
|
||||
Serial.println(F("panel task terminating"));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -78,6 +78,8 @@ void console_thread_wrapper_panel(void *const c)
|
|||
console *const cnsl = reinterpret_cast<console *>(c);
|
||||
|
||||
cnsl->panel_update_thread();
|
||||
|
||||
vTaskSuspend(nullptr);
|
||||
}
|
||||
|
||||
uint32_t load_serial_speed_configuration()
|
||||
|
|
|
@ -45,8 +45,8 @@ monitor_speed = 115200
|
|||
upload_speed = 1000000
|
||||
board_build.filesystem = littlefs
|
||||
lib_deps = greiman/SdFat@^2.1.2
|
||||
adafruit/Adafruit NeoPixel
|
||||
bblanchon/ArduinoJson@^6.19.4
|
||||
adafruit/Adafruit NeoPixel
|
||||
bblanchon/ArduinoJson@^6.19.4
|
||||
build_flags = -std=gnu++17 -DESP32=1 -ggdb3 -D_GLIBCXX_USE_C99 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -DCONFIG_SPIRAM_USE_MALLOC
|
||||
build_unflags = -std=gnu++11
|
||||
extra_scripts = pre:prepare.py
|
||||
|
|
|
@ -101,12 +101,12 @@ std::pair<breakpoint_register *, std::optional<std::string> > breakpoint_registe
|
|||
else if (key == "PC" || key == "pc") {
|
||||
return { new breakpoint_register(b, 7, values), { } };
|
||||
}
|
||||
else if (key.substr(0, 3) == "MMR" or key.substr(0, 3) == "mmr") {
|
||||
else if (key.substr(0, 3) == "MMR" || key.substr(0, 3) == "mmr") {
|
||||
int which = key[3] - '0';
|
||||
|
||||
return { new breakpoint_register(b, hr_mmr0 + which, values), { } };
|
||||
}
|
||||
else if (key.substr(0, 3) == "PSW" or key.substr(0, 3) == "psw") {
|
||||
else if (key.substr(0, 3) == "PSW" || key.substr(0, 3) == "psw") {
|
||||
return { new breakpoint_register(b, hr_psw, values), { } };
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@ private:
|
|||
#endif
|
||||
|
||||
protected:
|
||||
std::atomic_uint32_t *const stop_event { nullptr };
|
||||
std::atomic_uint32_t *const stop_event { nullptr };
|
||||
std::atomic_bool stop_panel { false };
|
||||
|
||||
bus *b { nullptr };
|
||||
#if !defined(BUILD_FOR_RP2040)
|
||||
|
@ -88,5 +89,6 @@ public:
|
|||
std::atomic_bool * get_disk_read_activity_flag() { return &disk_read_activity_flag; }
|
||||
std::atomic_bool * get_disk_write_activity_flag() { return &disk_write_activity_flag; }
|
||||
|
||||
void stop_panel_thread() { stop_panel = true; }
|
||||
virtual void panel_update_thread() = 0;
|
||||
};
|
||||
|
|
|
@ -133,7 +133,7 @@ void console_ncurses::panel_update_thread()
|
|||
|
||||
constexpr int refresh_rate = 50;
|
||||
|
||||
while(*stop_event != EVENT_TERMINATE) {
|
||||
while(*stop_event != EVENT_TERMINATE && stop_panel == false) {
|
||||
myusleep(1000000 / refresh_rate);
|
||||
|
||||
// note that these are approximately as there's no mutex on the emulation
|
||||
|
|
11
debugger.cpp
11
debugger.cpp
|
@ -942,7 +942,10 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
|
|||
}
|
||||
#endif
|
||||
else if (parts[0] == "setsl" && parts.size() == 3) {
|
||||
setloghost(parts.at(1).c_str(), parse_ll(parts[2]));
|
||||
if (setloghost(parts.at(1).c_str(), parse_ll(parts[2])) == false)
|
||||
cnsl->put_string_lf("Failed parsing IP address");
|
||||
else
|
||||
send_syslog(info, "Hello, world!");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
@ -951,6 +954,11 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
|
|||
|
||||
continue;
|
||||
}
|
||||
else if (cmd == "dp") {
|
||||
cnsl->stop_panel_thread();
|
||||
|
||||
continue;
|
||||
}
|
||||
else if (cmd == "bt") {
|
||||
if (c->get_debug() == false)
|
||||
cnsl->put_string_lf("Debug mode is disabled!");
|
||||
|
@ -1006,6 +1014,7 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
|
|||
"ser - serialize state to a file",
|
||||
// "dser - deserialize state from a file",
|
||||
#endif
|
||||
"dp - disable panel",
|
||||
#if defined(ESP32)
|
||||
"cfgnet - configure network (e.g. WiFi)",
|
||||
"startnet - start network",
|
||||
|
|
9
log.cpp
9
log.cpp
|
@ -54,16 +54,19 @@ void setlogfile(const char *const lf, const log_level_t ll_file, const log_level
|
|||
atexit(closelog);
|
||||
}
|
||||
|
||||
void setloghost(const char *const host, const log_level_t ll)
|
||||
bool setloghost(const char *const host, const log_level_t ll)
|
||||
{
|
||||
inet_aton(host, &syslog_ip_addr.sin_addr);
|
||||
syslog_ip_addr.sin_port = htons(514);
|
||||
syslog_ip_addr.sin_family = AF_INET;
|
||||
bool ok = inet_aton(host, &syslog_ip_addr.sin_addr) == 1;
|
||||
syslog_ip_addr.sin_port = htons(514);
|
||||
|
||||
is_file = false;
|
||||
|
||||
log_level_file = ll;
|
||||
|
||||
l_timestamp = false;
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
void setll(const log_level_t ll_screen, const log_level_t ll_file)
|
||||
|
|
3
log.h
3
log.h
|
@ -12,9 +12,10 @@ typedef enum { ll_emerg = 0, ll_alert, ll_critical, ll_error, warning, notice, i
|
|||
|
||||
log_level_t parse_ll(const std::string & str);
|
||||
void setlogfile(const char *const lf, const log_level_t ll_file, const log_level_t ll_screen, const bool l_timestamp);
|
||||
void setloghost(const char *const host, const log_level_t ll);
|
||||
bool setloghost(const char *const host, const log_level_t ll);
|
||||
void setll(const log_level_t ll_screen, const log_level_t ll_file);
|
||||
void setloguid(const int uid, const int gid);
|
||||
void send_syslog(const int ll, const std::string & what);
|
||||
void closelog();
|
||||
void dolog(const log_level_t ll, const char *fmt, ...);
|
||||
|
||||
|
|
1
mmu.cpp
1
mmu.cpp
|
@ -9,6 +9,7 @@
|
|||
|
||||
mmu::mmu()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
mmu::~mmu()
|
||||
|
|
2
rl02.cpp
2
rl02.cpp
|
@ -365,7 +365,7 @@ void rl02::writeWord(const uint16_t addr, uint16_t v)
|
|||
*disk_read_activity = false;
|
||||
}
|
||||
else {
|
||||
DOLOG(warning, false, "RL02: command %d not implemented", command);
|
||||
DOLOG(debug, false, "RL02: command %d not implemented", command);
|
||||
}
|
||||
|
||||
if (do_int) {
|
||||
|
|
Loading…
Add table
Reference in a new issue