Commit 86f990a7 authored by Maciej Lipinski's avatar Maciej Lipinski

[Issue #6] change wrsw_version to show SCB version by default

changed parameter for showing backplane version from -p to -b,
left -p for backward compatibility/WWW
parent ebc15714
...@@ -44,8 +44,8 @@ void help(const char* pgrname) ...@@ -44,8 +44,8 @@ void help(const char* pgrname)
{ {
printf("usage: %s <command>\n", pgrname); printf("usage: %s <command>\n", pgrname);
printf("available commands are:\n" printf("available commands are:\n"
" -p PCB version\n" " -b backplane hardware version (also '-p' for WWW)\n"
" -s scb version (without dot in version number)\n" " -s scb hardware version (without dot in version number)\n"
" -f FPGA type\n" " -f FPGA type\n"
" -F FPGA type and init status LED\n" " -F FPGA type and init status LED\n"
" -g Gateware version\n" " -g Gateware version\n"
...@@ -237,6 +237,8 @@ int main(int argc, char **argv) ...@@ -237,6 +237,8 @@ int main(int argc, char **argv)
case 'f': /* Warning: this -p and -f is used by the web interface */ case 'f': /* Warning: this -p and -f is used by the web interface */
printf("%s\n", get_fpga()); printf("%s\n", get_fpga());
break; break;
case 'b':
func='p';
case 'p': /* Warning: this -p and -f is used by the web interface */ case 'p': /* Warning: this -p and -f is used by the web interface */
printf("%s\n",get_shw_info(func)); printf("%s\n",get_shw_info(func));
break; break;
...@@ -255,9 +257,17 @@ int main(int argc, char **argv) ...@@ -255,9 +257,17 @@ int main(int argc, char **argv)
break; break;
case 'a': case 'a':
/* Warning: this with "awk '{print $4}'" is ued by the web if */ /* Warning: this with "awk '{print $4}'" is ued by the web if */
printf("PCB:%s, FPGA:%s; version: %s (%s); compiled at %s %s\n", printf("SCB HW:%s, ", sdb_get("scb_version", NULL));
get_shw_info('p'), get_fpga(), /* Printing this line is intentionally divided into two printf()
__GIT_VER__, __GIT_USR__, __DATE__, __TIME__); functions. The reason being:
function get_fpga() uses sdb_get(). The sdb_get() returns
static char result[] buffer. If the sdb_get() is called two
times in a single printf(), both instances of sdb_get() will
return the content of buffer acquired when sdb_get() was
called last.
*/
printf("FPGA:%s; version: %s (%s); compiled at %s %s\n",
get_fpga(),__GIT_VER__, __GIT_USR__, __DATE__, __TIME__);
break; break;
case 's': case 's':
printf("%s\n", remove_dots(sdb_get("scb_version", NULL))); printf("%s\n", remove_dots(sdb_get("scb_version", NULL)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment