mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Added software version + git short hash string to firmware.
The Makefile has the version number and generates a version.h which
has VERSION_SW define that looks like "v<VERSION>-g<GIT_SHORT_HASH>".
Software version shows at boot in the serial console.
And shown with command: `version`.
It can also be requested via `information.json`.
```
{
"ip_address": "192.168.10.247",
"ip_gateway": "192.168.10.1",
"ip_netmask": "255.255.255.0",
"mac_address": "1c:2a:a3:23:00:02",
"sw_ver": "v0.1.0-gd48235f",
"hw_ver": "SWGT024-V2.0"
}
```
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "rtl837x_sfr.h"
|
||||
#include "rtl837x_stp.h"
|
||||
#include "uip/uip.h"
|
||||
#include "version.h"
|
||||
|
||||
#pragma codeseg BANK1
|
||||
#pragma constseg BANK1
|
||||
@@ -490,6 +491,13 @@ void print_gpio_status(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// Show software version
|
||||
void print_sw_version(void) __banked {
|
||||
print_string("Software version: ");
|
||||
print_string(VERSION_SW);
|
||||
write_char('\n');
|
||||
}
|
||||
|
||||
|
||||
// Identify command
|
||||
void cmd_parser(void) __banked
|
||||
@@ -695,6 +703,9 @@ void cmd_parser(void) __banked
|
||||
port_eee_status_all();
|
||||
}
|
||||
}
|
||||
if (cmd_compare(0, "version")) {
|
||||
print_sw_version();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user