Skip to content
Permalink
Browse files

Simplify System Information printing

  • Loading branch information...
mrehkopf committed Feb 28, 2019
1 parent f3b2fcf commit 4379f0eb84de1230123c5606102cfb9fb53190f7
Showing with 11 additions and 27 deletions.
  1. +11 −27 src/sysinfo.c
@@ -59,33 +59,21 @@ int write_sysinfo(int sd_measured) {
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
sram_addr += 40;
len = snprintf(linebuf, sizeof(linebuf), " ");
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
sram_memset(sram_addr, 40, 0x20);
sram_addr += 40;
if(disk_state == DISK_REMOVED) {
sd_measured = 0;
sd_tacc_max = 0;
sd_tacc_avg = 0;
len = snprintf(linebuf, sizeof(linebuf), " ");
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
sram_memset(sram_addr, 40, 0x20);
sram_addr += 40;
len = snprintf(linebuf, sizeof(linebuf), " ");
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
sram_memset(sram_addr, 40, 0x20);
sram_addr += 40;
len = snprintf(linebuf, sizeof(linebuf), " *** SD Card removed *** ");
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
sram_writestrn(" *** SD Card removed *** ", sram_addr, 40);
sram_addr += 40;
len = snprintf(linebuf, sizeof(linebuf), " ");
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
sram_memset(sram_addr, 40, 0x20);
sram_addr += 40;
len = snprintf(linebuf, sizeof(linebuf), " ");
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
sram_memset(sram_addr, 40, 0x20);
sram_addr += 40;
sd_ok = 0;
} else {
@@ -115,9 +103,7 @@ int write_sysinfo(int sd_measured) {
sram_addr += 40;
sd_ok = 1;
}
len = snprintf(linebuf, sizeof(linebuf), " ");
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
sram_memset(sram_addr, 40, 0x20);
sram_addr += 40;
len = snprintf(linebuf, sizeof(linebuf), "CIC state: %s", get_cic_statefriendlyname(get_cic_state()));
memset(linebuf+len, 0x20, 40-len);
@@ -136,15 +122,13 @@ int write_sysinfo(int sd_measured) {
} else {
len = snprintf(linebuf, sizeof(linebuf), "Ultra16 serial no. %d (Autoboot Off)", ST.is_u16);
}
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
} else {
len = snprintf(linebuf, sizeof(linebuf), " ");
sram_memset(sram_addr, 40, 0x20);
}
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
sram_addr += 40;
len = snprintf(linebuf, sizeof(linebuf), " ");
memset(linebuf+len, 0x20, 40-len);
sram_writeblock(linebuf, sram_addr, 40);
sram_memset(sram_addr, 40, 0x20);
sram_hexdump(SRAM_SYSINFO_ADDR, 13*40);
if(sysclk != -1 && sd_ok && !sd_measured){
sdn_gettacc(&sd_tacc_max, &sd_tacc_avg);

0 comments on commit 4379f0e

Please sign in to comment.
You can’t perform that action at this time.