-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EE UART logging #171
base: master
Are you sure you want to change the base?
EE UART logging #171
Conversation
cd61916
to
13c29b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but real hardware
@@ -15,6 +15,10 @@ | |||
#include "time/timer.hpp" | |||
#include "./version.hpp" | |||
|
|||
#define LOGGING_STDOUT (0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace this C-Style code to C++ enums (like here).
_EESIO
can be misleading for Tyra beginners, what do you think about LOGGING_UART
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace this C-Style code to C++ enums (like here).
_EESIO
can be misleading for Tyra beginners, what do you think aboutLOGGING_UART
?
Maybe. If we explicitly say this is for EE.
Because DECKARD slims also have an additional UART for their emulated IOP
Rn I don't have my PC at hand. Will fix later
demo/src/main.cpp
Outdated
if (Demo::IS_REAL_PS2_VIA_USB) { | ||
options.writeLogsToFile = true; | ||
options.loggingMode = LOGGING_EESIO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should keep, file logging as default.
You can consider add comment like // UART logging can be used via loggingMode = ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry. Probably left it like that while testing it
@@ -15,8 +15,9 @@ | |||
int main() { | |||
Tyra::EngineOptions options; | |||
|
|||
options.loggingMode = LOGGING_EESIO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to fix this duplicate
#ifndef EESIO_UART_USE_SIOCOOKIE | ||
sio_init(38400, 0, 0, 0, 0); | ||
sio_putsn("TYRA: EE_SIO Enabled\n"); | ||
#else | ||
ee_sio_start(38400, 0, 0, 0, 0, 1); // alternative wrapper. initializes UART, but also re-routes STDOUT and STDERR FILE* streams to EE_SIO | ||
printf("TYRA: EE_SIO Enabled & STDOUT/STDERR hooked\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain this a bit more?
Correct me if I'm wrong:
- If somebody will use
LOGGING_EESIO
, all stdout logs (printf
) will by default go to UART? (#else) But we usesio_putsn()
anyway? - What will happen if somebody will declare
EESIO_UART_USE_SIOCOOKIE
? (which is not defined by default?)
BTW I see that you have EESIO_UART_USE_SIOCOOKIE
and EESIO_USE_SIOCOOKIE
(different name) is it a bug?
@@ -10,6 +10,7 @@ | |||
|
|||
#include "debug/debug.hpp" | |||
|
|||
bool EESIO_Initialized = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about making this variable as private static
? It will be inside TyraDebug
then
@@ -63,7 +72,7 @@ class TyraDebug { | |||
ss1 << "| Assertion failed!\n"; | |||
ss1 << "|\n"; | |||
|
|||
if (Tyra::Info::writeLogsToFile) { | |||
if (Tyra::Info::loggingMode == LOGGING_FILE) { | |||
writeInLogFile(&ss1); | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why LOGGING_EESIO
is not here?
@israpps ☝️ |
No description provided.