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

Merge pull request #20244 from benpicco/sys/shell/cmds-version

sys/shell: add firmware version to version cmd
This commit is contained in:
benpicco 2024-01-11 17:56:40 +00:00 committed by GitHub
commit 0c80553534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -11,3 +11,5 @@ FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += riotboot

View File

@ -15,3 +15,4 @@ FEATURES_PROVIDED += periph_usbdev
# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += tinyusb_device
FEATURES_PROVIDED += riotboot

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;
}