diff --git a/library.properties b/library.properties index a28648b..bf8e9f8 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=AzureIoTUtility -version=1.0.33 +version=1.0.34 author=Microsoft maintainer=Microsoft sentence=Azure C shared utility library for Arduino. For the Arduino MKR1000 or Zero and WiFi Shield 101, Adafruit Huzzah and Feather M0, or SparkFun Thing. diff --git a/src/AzureIoTUtility.h b/src/AzureIoTUtility.h index 7e3a979..279b3bf 100644 --- a/src/AzureIoTUtility.h +++ b/src/AzureIoTUtility.h @@ -7,6 +7,6 @@ #include "azure_c_shared_utility/lock.h" #include "azure_c_shared_utility/threadapi.h" -#define AzureIoTUtilityVersion "1.0.33" +#define AzureIoTUtilityVersion "1.0.34" #endif //AZUREIOTUTILITY_H diff --git a/src/azure_c_shared_utility/xlogging.h b/src/azure_c_shared_utility/xlogging.h index 64673e4..ffdaa8f 100644 --- a/src/azure_c_shared_utility/xlogging.h +++ b/src/azure_c_shared_utility/xlogging.h @@ -4,15 +4,24 @@ #ifndef XLOGGING_H #define XLOGGING_H +#include "azure_c_shared_utility/agenttime.h" +#include "azure_c_shared_utility/optimize_size.h" + +#if defined(ESP8266_RTOS) +#include "c_types.h" +#endif + +#if defined(ARDUINO_ARCH_ESP8266) +#include "esp8266/azcpgmspace.h" +#endif + #ifdef __cplusplus #include +extern "C" { #else #include #endif /* __cplusplus */ -#include "azure_c_shared_utility/agenttime.h" -#include "azure_c_shared_utility/optimize_size.h" - #ifdef TIZENRT #undef LOG_INFO #endif @@ -55,7 +64,6 @@ typedef void(*LOGGER_LOG_GETLASTERROR)(const char* file, const char* func, int l #define UNUSED(x) (void)(x) #elif defined(ESP8266_RTOS) -#include "c_types.h" #define LogInfo(FORMAT, ...) do { \ static const char flash_str[] ICACHE_RODATA_ATTR STORE_ATTR = FORMAT; \ printf(flash_str, ##__VA_ARGS__); \ @@ -83,7 +91,6 @@ const char* __localFORMAT = PSTR(FORMAT); On the other hand, vsprintf does not support the pinned 'format' and os_printf does not work with va_list, so we compacted the log in the macro LogInfo. */ -#include "esp8266/azcpgmspace.h" #define LOG(log_category, log_options, FORMAT, ...) { \ const char* __localFORMAT = PSTR(FORMAT); \ os_printf(__localFORMAT, ##__VA_ARGS__); \ @@ -156,24 +163,12 @@ extern LOGGER_LOG_GETLASTERROR xlogging_get_log_function_GetLastError(void); #define LogError(FORMAT, ...) do{ LOG(AZ_LOG_ERROR, LOG_LINE, FORMAT, ##__VA_ARGS__); }while((void)0,0) #endif -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - extern void xlogging_set_log_function(LOGGER_LOG log_function); extern LOGGER_LOG xlogging_get_log_function(void); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - #endif /* ARDUINO_ARCH_ESP8266 */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - /** * @brief Print the memory content byte pre byte in hexadecimal and as a char it the byte correspond to any printable ASCII chars. * @@ -189,7 +184,7 @@ extern "C" { extern void xlogging_dump_buffer(const void* buf, size_t size); #ifdef __cplusplus -} +} // extern "C" #endif /* __cplusplus */ #endif /* XLOGGING_H */