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
with:
check-path: 'code/nrf-connect'
exclude-regex: '\/build\/'
- name: Build blinky
uses: ./.github/actions/build
with:

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;
#ifndef CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL
#define CONFIG_PRSTLIB_DEFAULT_LOG_LEVEL LOG_LEVEL_WRN
#endif
#endif // _PRST_MACROS_H_

View file

@ -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 =

View file

@ -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);

View file

@ -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);

View file

@ -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));

View file

@ -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));

View file

@ -1,5 +1,6 @@
source "Kconfig.zephyr"
rsource "../../prstlib/Kconfig"
config PRST_SLEEP_DURATION_SEC
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"
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"

View file

@ -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