1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/shell: add firmware version to version cmd

This commit is contained in:
Benjamin Valentin 2024-01-11 14:38:15 +01:00
parent bb4c4ddf20
commit f932552b99

View File

@ -26,6 +26,9 @@
#ifdef MODULE_USB_BOARD_RESET
#include "usb_board_reset.h"
#endif
#ifdef MODULE_RIOTBOOT_SLOT
#include "riotboot/slot.h"
#endif
static int _reboot_handler(int argc, char **argv)
{
@ -60,6 +63,14 @@ static int _version_handler(int argc, char **argv)
puts(RIOT_VERSION);
#ifdef MODULE_RIOTBOOT_SLOT
int slot = riotboot_slot_current();
if (slot >= 0) {
const riotboot_hdr_t *hdr = riotboot_slot_get_hdr(slot);
printf("%s v%"PRIu32", slot %u\n", RIOT_APPLICATION, hdr->version, slot);
}
#endif
return 0;
}