Setup Kconfig for prstlib

This commit is contained in:
rbaron 2022-12-19 18:34:03 +01:00
parent c567408861
commit fe63fda2f1
12 changed files with 16 additions and 16 deletions

View file

@ -17,6 +17,7 @@ jobs:
uses: jidicula/clang-format-action@v4.9.0 uses: jidicula/clang-format-action@v4.9.0
with: with:
check-path: 'code/nrf-connect' check-path: 'code/nrf-connect'
exclude-regex: '\/build\/'
- name: Build blinky - name: Build blinky
uses: ./.github/actions/build uses: ./.github/actions/build
with: with:
@ -77,4 +78,4 @@ jobs:
with: with:
sample-dir: code/nrf-connect/samples/zigbee sample-dir: code/nrf-connect/samples/zigbee
board: bparasite_nrf52840 board: bparasite_nrf52840
output-bin: zigbee_nrf52840_default.hex output-bin: zigbee_nrf52840_default.hex

View file

@ -0,0 +1,3 @@
module = PRSTLIB
module-str = prstlib
source "subsys/logging/Kconfig.template.log_config"

View file

@ -21,8 +21,4 @@
#define UNUSED_OK(expr) (void)expr; #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_ #endif // _PRST_MACROS_H_

View file

@ -9,7 +9,7 @@
#include "prstlib/macros.h" #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. // PWM spec for square wave. Input to the soil sensing circuit.
static const struct pwm_dt_spec soil_pwm_dt = static const struct pwm_dt_spec soil_pwm_dt =

View file

@ -6,7 +6,7 @@
#include "prstlib/led.h" #include "prstlib/led.h"
#include "prstlib/macros.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 = static struct gpio_dt_spec button =
GPIO_DT_SPEC_GET(DT_NODELABEL(button0), gpios); GPIO_DT_SPEC_GET(DT_NODELABEL(button0), gpios);

View file

@ -4,7 +4,7 @@
#include "prstlib/macros.h" #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); struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_NODELABEL(led0), gpios);

View file

@ -6,7 +6,7 @@
#include "prstlib/led.h" #include "prstlib/led.h"
#include "prstlib/macros.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) { int prst_sensors_read_all(prst_sensors_t *sensors) {
RET_IF_ERR(prst_adc_batt_read(&sensors->batt)); RET_IF_ERR(prst_adc_batt_read(&sensors->batt));

View file

@ -6,7 +6,7 @@
#include "prstlib/macros.h" #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)); static const struct i2c_dt_spec shtc3 = I2C_DT_SPEC_GET(DT_NODELABEL(shtc3));

View file

@ -1,5 +1,6 @@
source "Kconfig.zephyr" source "Kconfig.zephyr"
rsource "../../prstlib/Kconfig"
config PRST_SLEEP_DURATION_SEC config PRST_SLEEP_DURATION_SEC
int "Sleep duration in seconds" int "Sleep duration in seconds"

View file

@ -0,0 +1,2 @@
source "Kconfig.zephyr"
rsource "../../prstlib/Kconfig"

View file

@ -1,4 +1,5 @@
source "Kconfig.zephyr" source "Kconfig.zephyr"
rsource "../../prstlib/Kconfig"
config PRST_ZB_SLEEP_DURATION_SEC config PRST_ZB_SLEEP_DURATION_SEC
int "Sleep duration between waking up and reading sensors (in seconds)" 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)" int "Interval for when b-parasite polls its parent for data (in seconds)"
default 60 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 config PRST_ZB_BUILD_DATE
string "Zigbee app init basic date code. Can be used as build revision. (1 byte)" string "Zigbee app init basic date code. Can be used as build revision. (1 byte)"
default "20221214" default "20221214"
@ -22,4 +19,4 @@ config PRST_ZB_MODEL_ID
config PRST_ZB_HARDWARE_VERSION config PRST_ZB_HARDWARE_VERSION
int "Zigbee basic cluster hardware version. (1 byte)" int "Zigbee basic cluster hardware version. (1 byte)"
default 2 default 2

View file

@ -46,4 +46,4 @@ CONFIG_RAM_POWER_DOWN_LIBRARY=y
CONFIG_PRST_ZB_SLEEP_DURATION_SEC=10 CONFIG_PRST_ZB_SLEEP_DURATION_SEC=10
CONFIG_LOG_DEFAULT_LEVEL=4 CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL=4 CONFIG_PRSTLIB_LOG_LEVEL_DBG=y