Setup Kconfig for prstlib
This commit is contained in:
parent
c567408861
commit
fe63fda2f1
12 changed files with 16 additions and 16 deletions
3
.github/workflows/b-parasite.yml
vendored
3
.github/workflows/b-parasite.yml
vendored
|
|
@ -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
|
||||
output-bin: zigbee_nrf52840_default.hex
|
||||
|
|
|
|||
3
code/nrf-connect/prstlib/Kconfig
Normal file
3
code/nrf-connect/prstlib/Kconfig
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module = PRSTLIB
|
||||
module-str = prstlib
|
||||
source "subsys/logging/Kconfig.template.log_config"
|
||||
|
|
@ -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_
|
||||
|
|
@ -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 =
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
|
||||
source "Kconfig.zephyr"
|
||||
rsource "../../prstlib/Kconfig"
|
||||
|
||||
config PRST_SLEEP_DURATION_SEC
|
||||
int "Sleep duration in seconds"
|
||||
|
|
|
|||
2
code/nrf-connect/samples/soil_read_loop/Kconfig
Normal file
2
code/nrf-connect/samples/soil_read_loop/Kconfig
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
source "Kconfig.zephyr"
|
||||
rsource "../../prstlib/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
|
||||
default 2
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue