sample: button: Fix format specifier
k_cycle_get_32() returns an unsigned 32-bit integer, while the '%d' specifier denotes a signed integer. Using the proper C99 format specifier resolves the problem. Signed-off-by: Reto Schneider <code@reto-schneider.ch>
This commit is contained in:
parent
7f757e64d3
commit
61733a8fe5
1 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <drivers/gpio.h>
|
||||
#include <sys/util.h>
|
||||
#include <sys/printk.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
/* change this to use another GPIO port */
|
||||
#ifndef DT_ALIAS_SW0_GPIOS_CONTROLLER
|
||||
|
@ -55,7 +56,7 @@
|
|||
void button_pressed(struct device *gpiob, struct gpio_callback *cb,
|
||||
u32_t pins)
|
||||
{
|
||||
printk("Button pressed at %d\n", k_cycle_get_32());
|
||||
printk("Button pressed at %" PRIu32 "\n", k_cycle_get_32());
|
||||
}
|
||||
|
||||
static struct gpio_callback gpio_cb;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue