Skip to content

Commit 484b224

Browse files
Emil Obalskirlubos
authored andcommitted
applications: machine_learning: Add App specific event descr option
This change adds default Application specific Kconfig option that defines sensor event descriptor that application modules are listening to. This commit also makes use of this option in machine_learning application. Signed-off-by: Emil Obalski <[email protected]>
1 parent b549770 commit 484b224

File tree

22 files changed

+52
-31
lines changed

22 files changed

+52
-31
lines changed

applications/machine_learning/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66

77
menu "Machine learning application"
8+
rsource "src/Kconfig.ml_app"
89
rsource "src/events/Kconfig"
910
rsource "src/modules/Kconfig"
1011
endmenu

applications/machine_learning/configuration/nrf52840dk_nrf52840/prj.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
################################################################################
77
# Application configuration
88

9+
CONFIG_ML_APP_SENSOR_EVENT_DESCR="accel_sim_xyz"
10+
911
CONFIG_ML_APP_EI_DATA_FORWARDER=y
1012
CONFIG_ML_APP_EI_DATA_FORWARDER_UART=y
11-
CONFIG_ML_APP_EI_DATA_FORWARDER_SENSOR_EVENT_DESCR="accel_sim_xyz"
1213

1314
CONFIG_ML_APP_ML_RUNNER=y
14-
CONFIG_ML_APP_ML_RUNNER_SENSOR_EVENT_DESCR="accel_sim_xyz"
1515
CONFIG_ML_APP_ML_RUNNER_WINDOW_SHIFT=1
1616
CONFIG_ML_APP_ML_RUNNER_FRAME_SHIFT=0
1717

applications/machine_learning/configuration/nrf52840dk_nrf52840/prj_nus.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# This ZDebug build type configuration uses Bluetooth NUS for data forwarding instead of the default UART.
1010
# Application configuration
1111

12+
CONFIG_ML_APP_SENSOR_EVENT_DESCR="accel_sim_xyz"
13+
1214
CONFIG_ML_APP_EI_DATA_FORWARDER=y
1315
CONFIG_ML_APP_EI_DATA_FORWARDER_BT_NUS=y
1416
CONFIG_ML_APP_EI_DATA_FORWARDER_PIPELINE_COUNT=3
1517
CONFIG_ML_APP_EI_DATA_FORWARDER_BUF_COUNT=6
16-
CONFIG_ML_APP_EI_DATA_FORWARDER_SENSOR_EVENT_DESCR="accel_sim_xyz"
1718

1819
CONFIG_ML_APP_ML_RUNNER=y
19-
CONFIG_ML_APP_ML_RUNNER_SENSOR_EVENT_DESCR="accel_sim_xyz"
2020
CONFIG_ML_APP_ML_RUNNER_WINDOW_SHIFT=1
2121
CONFIG_ML_APP_ML_RUNNER_FRAME_SHIFT=0
2222

applications/machine_learning/configuration/nrf52840dk_nrf52840/prj_release.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
################################################################################
77
# Application configuration
88

9+
CONFIG_ML_APP_SENSOR_EVENT_DESCR="accel_sim_xyz"
10+
911
CONFIG_ML_APP_EI_DATA_FORWARDER=y
1012
CONFIG_ML_APP_EI_DATA_FORWARDER_UART=y
11-
CONFIG_ML_APP_EI_DATA_FORWARDER_SENSOR_EVENT_DESCR="accel_sim_xyz"
1213

1314
CONFIG_ML_APP_ML_RUNNER=y
14-
CONFIG_ML_APP_ML_RUNNER_SENSOR_EVENT_DESCR="accel_sim_xyz"
1515
CONFIG_ML_APP_ML_RUNNER_WINDOW_SHIFT=1
1616
CONFIG_ML_APP_ML_RUNNER_FRAME_SHIFT=0
1717

applications/machine_learning/configuration/nrf52840dk_nrf52840/sensor_manager_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static const struct sm_sampled_channel accel_chan[] = {
3434
static const struct sm_sensor_config sensor_configs[] = {
3535
{
3636
.dev_name = CONFIG_SENSOR_SIM_DEV_NAME,
37-
.event_descr = "accel_sim_xyz",
37+
.event_descr = CONFIG_ML_APP_SENSOR_EVENT_DESCR,
3838
.chans = accel_chan,
3939
.chan_cnt = ARRAY_SIZE(accel_chan),
4040
.sampling_period_ms = 20,

applications/machine_learning/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
################################################################################
77
# Application configuration
88

9+
CONFIG_ML_APP_SENSOR_EVENT_DESC="accel_sim_xyz"
10+
911
CONFIG_ML_APP_EI_DATA_FORWARDER=y
1012
CONFIG_ML_APP_EI_DATA_FORWARDER_UART=y
11-
CONFIG_ML_APP_EI_DATA_FORWARDER_SENSOR_EVENT_DESCR="accel_sim_xyz"
1213

1314
CONFIG_ML_APP_ML_RUNNER=y
14-
CONFIG_ML_APP_ML_RUNNER_SENSOR_EVENT_DESCR="accel_sim_xyz"
1515
CONFIG_ML_APP_ML_RUNNER_WINDOW_SHIFT=1
1616
CONFIG_ML_APP_ML_RUNNER_FRAME_SHIFT=0
1717

applications/machine_learning/configuration/nrf5340dk_nrf5340_cpuapp/sensor_manager_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static const struct sm_sampled_channel accel_chan[] = {
3434
static const struct sm_sensor_config sensor_configs[] = {
3535
{
3636
.dev_name = CONFIG_SENSOR_SIM_DEV_NAME,
37-
.event_descr = "accel_sim_xyz",
37+
.event_descr = CONFIG_ML_APP_SENSOR_EVENT_DESCR,
3838
.chans = accel_chan,
3939
.chan_cnt = ARRAY_SIZE(accel_chan),
4040
.sampling_period_ms = 20,

applications/machine_learning/configuration/thingy52_nrf52832/prj.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
################################################################################
77
# Application configuration
88

9+
CONFIG_ML_APP_SENSOR_EVENT_DESC="accel_xyz"
10+
911
CONFIG_ML_APP_EI_DATA_FORWARDER=y
1012
CONFIG_ML_APP_EI_DATA_FORWARDER_BT_NUS=y
1113
CONFIG_ML_APP_EI_DATA_FORWARDER_PIPELINE_COUNT=3
1214
CONFIG_ML_APP_EI_DATA_FORWARDER_BUF_COUNT=6
13-
CONFIG_ML_APP_EI_DATA_FORWARDER_SENSOR_EVENT_DESCR="accel_xyz"
1415

1516
CONFIG_ML_APP_LED_STATE=y
1617
CONFIG_ML_APP_LED_STATE_VALUE_THRESH=700
1718
CONFIG_ML_APP_LED_STATE_ANOMALY_THRESH=300
1819
CONFIG_ML_APP_LED_STATE_PREDICTION_STREAK_THRESH=3
1920

2021
CONFIG_ML_APP_ML_RUNNER=y
21-
CONFIG_ML_APP_ML_RUNNER_SENSOR_EVENT_DESCR="accel_xyz"
2222
CONFIG_ML_APP_ML_RUNNER_WINDOW_SHIFT=0
2323
CONFIG_ML_APP_ML_RUNNER_FRAME_SHIFT=10
2424

applications/machine_learning/configuration/thingy52_nrf52832/prj_release.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
################################################################################
77
# Application configuration
88

9+
CONFIG_ML_APP_SENSOR_EVENT_DESC="accel_xyz"
10+
911
CONFIG_ML_APP_EI_DATA_FORWARDER=y
1012
CONFIG_ML_APP_EI_DATA_FORWARDER_BT_NUS=y
1113
CONFIG_ML_APP_EI_DATA_FORWARDER_PIPELINE_COUNT=3
1214
CONFIG_ML_APP_EI_DATA_FORWARDER_BUF_COUNT=6
13-
CONFIG_ML_APP_EI_DATA_FORWARDER_SENSOR_EVENT_DESCR="accel_xyz"
1415

1516
CONFIG_ML_APP_LED_STATE=y
1617
CONFIG_ML_APP_LED_STATE_VALUE_THRESH=700
1718
CONFIG_ML_APP_LED_STATE_ANOMALY_THRESH=300
1819
CONFIG_ML_APP_LED_STATE_PREDICTION_STREAK_THRESH=3
1920

2021
CONFIG_ML_APP_ML_RUNNER=y
21-
CONFIG_ML_APP_ML_RUNNER_SENSOR_EVENT_DESCR="accel_xyz"
2222
CONFIG_ML_APP_ML_RUNNER_WINDOW_SHIFT=0
2323
CONFIG_ML_APP_ML_RUNNER_FRAME_SHIFT=10
2424

applications/machine_learning/configuration/thingy52_nrf52832/sensor_manager_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static const struct sm_sampled_channel accel_chan[] = {
2626
static const struct sm_sensor_config sensor_configs[] = {
2727
{
2828
.dev_name = "LIS2DH12-ACCEL",
29-
.event_descr = "accel_xyz",
29+
.event_descr = CONFIG_ML_APP_SENSOR_EVENT_DESCR,
3030
.chans = accel_chan,
3131
.chan_cnt = ARRAY_SIZE(accel_chan),
3232
.sampling_period_ms = 20,

0 commit comments

Comments
 (0)