Skip to content

Commit e82b899

Browse files
committed
samples: cellular: lwm2m_client: Only include FOTA file if enabled
Only includes a file needed for FOTA if the actual feature is enabled, otherwise don't Signed-off-by: Jamie McCrae <[email protected]>
1 parent ffb2353 commit e82b899

File tree

1 file changed

+9
-6
lines changed
  • samples/cellular/lwm2m_client/src

1 file changed

+9
-6
lines changed

samples/cellular/lwm2m_client/src/main.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ LOG_MODULE_REGISTER(app_lwm2m_client, CONFIG_APP_LOG_LEVEL);
2929

3030
#include <zephyr/device.h>
3131
#include <zephyr/devicetree.h>
32+
33+
#if defined(CONFIG_APP_SMP_CLIENT_FOTA_EXTERNAL)
3234
#include "fota_app_external.h"
35+
#endif
3336

3437
#if defined(CONFIG_LWM2M_CLIENT_UTILS_LOCATION_ASSISTANCE)
3538
#include "ui_input.h"
@@ -571,13 +574,13 @@ int main(void)
571574
return 0;
572575
}
573576

574-
if (IS_ENABLED(CONFIG_APP_SMP_CLIENT_FOTA_EXTERNAL)) {
575-
ret = fota_external_init();
576-
if (ret < 0) {
577-
LOG_ERR("Unable to init Fota external client (%d)", ret);
578-
return 0;
579-
}
577+
#if defined(CONFIG_APP_SMP_CLIENT_FOTA_EXTERNAL)
578+
ret = fota_external_init();
579+
if (ret < 0) {
580+
LOG_ERR("Unable to init Fota external client (%d)", ret);
581+
return 0;
580582
}
583+
#endif
581584

582585
ret = app_event_manager_init();
583586
if (ret) {

0 commit comments

Comments
 (0)