Skip to content

Commit

Permalink
samples/drivers/counter: alarm: fix printk usage
Browse files Browse the repository at this point in the history
When displaying int and u32_t, use %u instead of %d.


Signed-off-by: Erwan Gouriou <[email protected]>
  • Loading branch information
erwango authored and galak committed Mar 26, 2019
1 parent a5cb920 commit 25d0404
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/drivers/counter/alarm/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ static void test_counter_interrupt_fn(struct device *counter_dev,
struct counter_alarm_cfg *config = user_data;

printk("!!! Alarm !!!\n");
printk("Now: %d\n", now_sec);
printk("Now: %u\n", now_sec);

/* Set a new alarm with a double lenght duration */
config->ticks = 2 * config->ticks;

printk("Set alarm in %d sec\n", config->ticks);
printk("Set alarm in %u sec\n", config->ticks);
counter_set_channel_alarm(counter_dev, ALARM_CHANNEL_ID, user_data);
}

Expand Down

0 comments on commit 25d0404

Please sign in to comment.