Replies: 5 comments
-
That would be really cool. Let me have a Quick Look at the logging. I have a feeling it might already be routed through a single place already. |
Beta Was this translation helpful? Give feedback.
-
So, if you look in this file: https://github.com/atomic14/esp32-zxspectrum/blob/main/firmware/src/Serial.h There's a #define you can use with Arduino - This removes the global Serial class completely. You can then substitute you own version using We'd have to rejig the code a bit, but that would give you a way to globally turn off |
Beta Was this translation helpful? Give feedback.
-
The other thing that might be an idea to look at is the code here: https://github.com/atomic14/esp32-zxspectrum/tree/main/firmware/src/SerialInterface This is a simple (very simple) protocol that is used for communicating with the website and handles packets of data. So may be worth wrapping up anything in that - if it's easy. |
Beta Was this translation helpful? Give feedback.
-
Actually, I've thought about this some more - there's only really some performance logging when the emulator is running - so we could just turn that off if the debugger is connected? |
Beta Was this translation helpful? Give feedback.
-
I tried multiple things, so the code is a bit of a mess, but the thing that worked better so far is similar to the last idea. I replaced all Serial.printXXX with macros that call Serial.printf after checking a global log level setting. When starting the debug session I set the log level to 0 which cuts out the logging. This has the benefit that the logging level could be changed dynamically in the future if needed. Since DeZog uses its own protocol, I have to cut off the file transfer as well when debugging. I've added a new menu entry for the debugger that starts the emulator in debugging mode. So after reset everything is business as usual, but when that menu entry is used, the emulator starts with logging off and a flag set to indicate debugging. Serial is then used just for DeZog communication. To get back to normal, a reset is needed. One question I have - I've only touched the logging entries that happen in the emulator. Should the others be changed as well to keep things nice and uniform? It's mostly the startup messages there. Anyway, I have to work a bit to tidy up things and i can push it to my fork for review when it's more presentable. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been working on implementing DeZog's debugger protocol in the firmware (using its ZxNext serial protocol). I got to a spot where I can step through code, set breakpoints, change reg values, but it's still WIP. The only caveat is that all the debugging serial output from the Rainbow needs to be turned off (since the protocol works over the serial connection). I tested by just turning off everything in config, but this could also be done using the ESP32 logging library, which could be turned on and off as needed. This would imply though that most of the Serial.printXXX will need to be replaced with ESP_LOGx. Is there any interest to see this in the main code base at some point, or should I just keep a fork for my own purposes?
Beta Was this translation helpful? Give feedback.
All reactions