Skip to content

Commit 8725098

Browse files
committed
Properly exclude unused code, initialize logging properly in pure ESP-IDF
1 parent f12ebd1 commit 8725098

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

components/robusto/base/src/logging/logging_esp-idf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#include <robusto_logging.h>
3434
#ifdef USE_ESPIDF
35-
#define CONFIG_LOG_MAXIMUM_LEVEL CONFIG_ROB_LOG_MAXIMUM_LEVEL
3635
#if ROB_LOG_LOCAL_LEVEL > ROB_LOG_NONE
3736

3837
#include <esp_log.h>
@@ -45,7 +44,7 @@ void compat_rob_log_writev(rob_log_level_t level, const char *tag, const char *f
4544
// On the ESP platform, there is no need for the sparse mode.
4645
void compat_rob_log_write_sparse(const char *tag, const char *format)
4746
{
48-
va_list arg_list;
47+
va_list arg_list = NULL;
4948
compat_rob_log_writev(ROB_LOG_LOCAL_LEVEL, tag, format, arg_list);
5049
}
5150
#endif

components/robusto/network/src/media/radio/XPowers/init_pmu.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22
#include <robconfig.h>
3+
// make sure this is only compiled when needed
4+
#ifdef CONFIG_ROBUSTO_SUPPORTS_LORA
35
#ifdef __cplusplus
46
extern "C"
57
{
@@ -10,3 +12,4 @@ void init_pmu(void);
1012
#ifdef __cplusplus
1113
} /* extern "C" */
1214
#endif
15+
#endif

components/robusto/network/src/media/radio/XPowers/init_pmu_espidf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "init_pmu.hpp"
2+
#ifdef CONFIG_ROBUSTO_SUPPORTS_LORA
23
#ifdef USE_ESPIDF
34
#include <stdio.h>
45
#include <cstring>
@@ -86,4 +87,4 @@ static void pmu_hander_task(void *args)
8687

8788
#endif
8889

89-
90+
#endif

0 commit comments

Comments
 (0)