Skip to content

Commit 383e2bd

Browse files
Enable serial output and logging for battery example
1 parent 9d2691f commit 383e2bd

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

examples/zephyr-battery/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
#include <zephyr/drivers/regulator.h>
77
#include <zephyr/drivers/adc.h>
88
#include <zephyr/kernel.h>
9-
9+
#include <zephyr/logging/log.h>
10+
LOG_MODULE_REGISTER(battery, CONFIG_LOG_DEFAULT_LEVEL);
1011

1112
#if !DT_NODE_EXISTS(DT_PATH(zephyr_user)) || \
1213
!DT_NODE_HAS_PROP(DT_PATH(zephyr_user), io_channels)
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
CONFIG_GPIO=y
22
CONFIG_ADC=y
3-
CONFIG_ADC_ASYNC=y
3+
CONFIG_ADC_ASYNC=y
4+
5+
CONFIG_SERIAL=y
6+
CONFIG_STDOUT_CONSOLE=y
7+
CONFIG_PRINTK=y
8+
CONFIG_LOG=y
9+
CONFIG_LOG_PRINTK=y
10+
CONFIG_LOG_MODE_IMMEDIATE=y

0 commit comments

Comments
 (0)