diff --git a/.github/workflows/b-parasite.yml b/.github/workflows/b-parasite.yml index 4a165a8..3a241e7 100644 --- a/.github/workflows/b-parasite.yml +++ b/.github/workflows/b-parasite.yml @@ -17,6 +17,7 @@ jobs: uses: jidicula/clang-format-action@v4.9.0 with: check-path: 'code/nrf-connect' + exclude-regex: '\/build\/' - name: Build blinky uses: ./.github/actions/build with: @@ -77,4 +78,4 @@ jobs: with: sample-dir: code/nrf-connect/samples/zigbee board: bparasite_nrf52840 - output-bin: zigbee_nrf52840_default.hex \ No newline at end of file + output-bin: zigbee_nrf52840_default.hex diff --git a/code/nrf-connect/prstlib/Kconfig b/code/nrf-connect/prstlib/Kconfig new file mode 100644 index 0000000..23a7071 --- /dev/null +++ b/code/nrf-connect/prstlib/Kconfig @@ -0,0 +1,3 @@ +module = PRSTLIB +module-str = prstlib +source "subsys/logging/Kconfig.template.log_config" diff --git a/code/nrf-connect/prstlib/include/prstlib/macros.h b/code/nrf-connect/prstlib/include/prstlib/macros.h index 694d7e6..dc3f82f 100644 --- a/code/nrf-connect/prstlib/include/prstlib/macros.h +++ b/code/nrf-connect/prstlib/include/prstlib/macros.h @@ -21,8 +21,4 @@ #define UNUSED_OK(expr) (void)expr; -#ifndef CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL -#define CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL LOG_LEVEL_WRN -#endif - #endif // _PRST_MACROS_H_ \ No newline at end of file diff --git a/code/nrf-connect/prstlib/src/adc.c b/code/nrf-connect/prstlib/src/adc.c index 06a42ad..f13232d 100644 --- a/code/nrf-connect/prstlib/src/adc.c +++ b/code/nrf-connect/prstlib/src/adc.c @@ -9,7 +9,7 @@ #include "prstlib/macros.h" -LOG_MODULE_REGISTER(adc, CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL); +LOG_MODULE_REGISTER(adc, CONFIG_PRSTLIB_LOG_LEVEL); // PWM spec for square wave. Input to the soil sensing circuit. static const struct pwm_dt_spec soil_pwm_dt = diff --git a/code/nrf-connect/prstlib/src/button.c b/code/nrf-connect/prstlib/src/button.c index 2243845..54f2f2a 100644 --- a/code/nrf-connect/prstlib/src/button.c +++ b/code/nrf-connect/prstlib/src/button.c @@ -6,7 +6,7 @@ #include "prstlib/led.h" #include "prstlib/macros.h" -LOG_MODULE_REGISTER(button, CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL); +LOG_MODULE_REGISTER(button, CONFIG_PRSTLIB_LOG_LEVEL); static struct gpio_dt_spec button = GPIO_DT_SPEC_GET(DT_NODELABEL(button0), gpios); diff --git a/code/nrf-connect/prstlib/src/led.c b/code/nrf-connect/prstlib/src/led.c index cd99937..9ba4d47 100644 --- a/code/nrf-connect/prstlib/src/led.c +++ b/code/nrf-connect/prstlib/src/led.c @@ -4,7 +4,7 @@ #include "prstlib/macros.h" -LOG_MODULE_REGISTER(led, CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL); +LOG_MODULE_REGISTER(led, CONFIG_PRSTLIB_LOG_LEVEL); struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_NODELABEL(led0), gpios); diff --git a/code/nrf-connect/prstlib/src/sensors.c b/code/nrf-connect/prstlib/src/sensors.c index e97a35f..b826d1c 100644 --- a/code/nrf-connect/prstlib/src/sensors.c +++ b/code/nrf-connect/prstlib/src/sensors.c @@ -6,7 +6,7 @@ #include "prstlib/led.h" #include "prstlib/macros.h" -LOG_MODULE_REGISTER(sensors, CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL); +LOG_MODULE_REGISTER(sensors, CONFIG_PRSTLIB_LOG_LEVEL); int prst_sensors_read_all(prst_sensors_t *sensors) { RET_IF_ERR(prst_adc_batt_read(&sensors->batt)); diff --git a/code/nrf-connect/prstlib/src/shtc3.c b/code/nrf-connect/prstlib/src/shtc3.c index 5e2103b..189a221 100644 --- a/code/nrf-connect/prstlib/src/shtc3.c +++ b/code/nrf-connect/prstlib/src/shtc3.c @@ -6,7 +6,7 @@ #include "prstlib/macros.h" -LOG_MODULE_REGISTER(shtc3, CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL); +LOG_MODULE_REGISTER(shtc3, CONFIG_PRSTLIB_LOG_LEVEL); static const struct i2c_dt_spec shtc3 = I2C_DT_SPEC_GET(DT_NODELABEL(shtc3)); diff --git a/code/nrf-connect/samples/ble/Kconfig b/code/nrf-connect/samples/ble/Kconfig index 6c505c1..d2d47c5 100644 --- a/code/nrf-connect/samples/ble/Kconfig +++ b/code/nrf-connect/samples/ble/Kconfig @@ -1,5 +1,6 @@ source "Kconfig.zephyr" +rsource "../../prstlib/Kconfig" config PRST_SLEEP_DURATION_SEC int "Sleep duration in seconds" diff --git a/code/nrf-connect/samples/soil_read_loop/Kconfig b/code/nrf-connect/samples/soil_read_loop/Kconfig new file mode 100644 index 0000000..8f070f8 --- /dev/null +++ b/code/nrf-connect/samples/soil_read_loop/Kconfig @@ -0,0 +1,2 @@ +source "Kconfig.zephyr" +rsource "../../prstlib/Kconfig" diff --git a/code/nrf-connect/samples/zigbee/Kconfig b/code/nrf-connect/samples/zigbee/Kconfig index f23bfef..c88d371 100644 --- a/code/nrf-connect/samples/zigbee/Kconfig +++ b/code/nrf-connect/samples/zigbee/Kconfig @@ -1,4 +1,5 @@ source "Kconfig.zephyr" +rsource "../../prstlib/Kconfig" config PRST_ZB_SLEEP_DURATION_SEC int "Sleep duration between waking up and reading sensors (in seconds)" @@ -8,10 +9,6 @@ config PRST_ZB_PARENT_POLL_INTERVAL_SEC int "Interval for when b-parasite polls its parent for data (in seconds)" default 60 -config PRSTLIB_DEFAULT_LOG_LEVEL - int "Logging level in core prst library. (0: NONE, 2: WARN, 4: DEBUG) See Zephyr logging for more." - default 2 - config PRST_ZB_BUILD_DATE string "Zigbee app init basic date code. Can be used as build revision. (1 byte)" default "20221214" @@ -22,4 +19,4 @@ config PRST_ZB_MODEL_ID config PRST_ZB_HARDWARE_VERSION int "Zigbee basic cluster hardware version. (1 byte)" - default 2 \ No newline at end of file + default 2 diff --git a/code/nrf-connect/samples/zigbee/prj_debug.conf b/code/nrf-connect/samples/zigbee/prj_debug.conf index a338a75..734b637 100644 --- a/code/nrf-connect/samples/zigbee/prj_debug.conf +++ b/code/nrf-connect/samples/zigbee/prj_debug.conf @@ -46,4 +46,4 @@ CONFIG_RAM_POWER_DOWN_LIBRARY=y CONFIG_PRST_ZB_SLEEP_DURATION_SEC=10 CONFIG_LOG_DEFAULT_LEVEL=4 -CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL=4 +CONFIG_PRSTLIB_LOG_LEVEL_DBG=y