More logging

This commit is contained in:
Vincent Barrilliot 2023-01-31 01:36:31 +01:00
parent 25dbadb1c0
commit 52caf47fce
3 changed files with 8 additions and 4 deletions

View file

@ -331,7 +331,7 @@ short sdc_write(long lba, const unsigned char * buffer, short size) {
short sdc_status() { short sdc_status() {
short status = g_sdc_status; short status = g_sdc_status;
TRACE("sdc_status"); TRACE1("sdc_status, status=0x%x",(int)status);
if (sdc_detected()) { if (sdc_detected()) {
// Add the PRESENT flag, if the card is inserted // Add the PRESENT flag, if the card is inserted
@ -343,7 +343,7 @@ short sdc_status() {
status |= SDC_STAT_PROTECTED; status |= SDC_STAT_PROTECTED;
} }
TRACE1("sdc_status: %x", (int)status); TRACE1("sdc_status: %x", (short)status);
return status; return status;
} }

View file

@ -268,13 +268,13 @@ void initialize() {
if (res = cli_init()) { if (res = cli_init()) {
log_num(LOG_ERROR, "FAILED: CLI initialization", res); log_num(LOG_ERROR, "FAILED: CLI initialization", res);
} else { } else {
log(LOG_INFO, "CLI initialized."); INFO("CLI initialized.");
} }
if (res = fsys_init()) { if (res = fsys_init()) {
log_num(LOG_ERROR, "FAILED: file system initialization", res); log_num(LOG_ERROR, "FAILED: file system initialization", res);
} else { } else {
log(LOG_INFO, "File system initialized."); INFO("File system initialized.");
} }
} }

View file

@ -166,6 +166,8 @@ extern void log_c(short log_level, char c);
# define TRACE3(a,b,c,d) trace(a, b, c, d) # define TRACE3(a,b,c,d) trace(a, b, c, d)
# define TRACE4(a,b,c,d,e) trace(a, b, c, d, e) # define TRACE4(a,b,c,d,e) trace(a, b, c, d, e)
# define TRACE5(a,b,c,d,e,f) trace(a, b, c, d, e, f) # define TRACE5(a,b,c,d,e,f) trace(a, b, c, d, e, f)
# define TRACE6(a,b,c,d,e,f,g) trace(a, b, c, d, e, f, g)
# define TRACE7(a,b,c,d,e,f,g,h) trace(a, b, c, d, e, f, g, h)
#else #else
# define TRACE(m) # define TRACE(m)
# define TRACE1(a,b) # define TRACE1(a,b)
@ -173,6 +175,8 @@ extern void log_c(short log_level, char c);
# define TRACE3(a,b,c,d) # define TRACE3(a,b,c,d)
# define TRACE4(a,b,c,d,e) # define TRACE4(a,b,c,d,e)
# define TRACE5(a,b,c,d,e,f) # define TRACE5(a,b,c,d,e,f)
# define TRACE6(a,b,c,d,e,f,g)
# define TRACE7(a,b,c,d,e,f,g,h)
#endif #endif
#define TRACEC(c) log_c(LOG_TRACE, c); #define TRACEC(c) log_c(LOG_TRACE, c);