Skip to content

Commit

Permalink
app: add optional firmware version boot banner
Browse files Browse the repository at this point in the history
Add an optional boot banner showing the version of the CANnectivity
firmware.

Signed-off-by: Henrik Brix Andersen <[email protected]>
  • Loading branch information
henrikbrixandersen committed Aug 27, 2024
1 parent 2dbf69d commit 0614eb6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ module = CANNECTIVITY
module-str = CANnectivity
source "subsys/logging/Kconfig.template.log_config"

config CANNECTIVITY_BOOT_BANNER
bool "CANnectivity boot banner"
default y if BOOT_BANNER
select PRINTK
help
Print the CANnectivity firmware version during boot up.

config CANNECTIVITY_USB_MANUFACTURER
string "USB device manufacturer string"
default "CANnectivity"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <cannectivity/usb/class/gs_usb.h>

#include "cannectivity.h"
#include "zephyr/app_version.h"

LOG_MODULE_REGISTER(main, CONFIG_CANNECTIVITY_LOG_LEVEL);

Expand Down Expand Up @@ -44,6 +45,10 @@ int main(void)
};
int err;

#ifdef CONFIG_CANNECTIVITY_BOOT_BANNER
printk("*** CANnectivity firmware version " APP_VERSION_STRING " ***\n");
#endif /* CONFIG_CANNECTIVITY_BOOT_BANNER */

if (!device_is_ready(gs_usb)) {
LOG_ERR("gs_usb USB device not ready");
return 0;
Expand Down

0 comments on commit 0614eb6

Please sign in to comment.