-
Notifications
You must be signed in to change notification settings - Fork 10
Compatibility with lwIP and ESP-IDF #13
base: master
Are you sure you want to change the base?
Changes from 2 commits
8fb16eb
b431d10
e109fca
10d16d6
d4f5bb7
da3f2f9
380864c
37319a5
87451c0
c5526dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,40 +34,46 @@ | |
|
||
#if !VERBOSE_DEBUG | ||
|
||
#define CSTR(x) (x) | ||
#define CSTR(x) (x) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather significant changes in the whitespace not be combined with material additions or changes to a file, unless it is unavoidable. It makes the diffs harder to read. That aside, I'm having trouble getting my brain to not be weirded out by the use of full indents, though. That's largely why I used single-space indents in |
||
|
||
#ifndef DEBUG_PRINTF | ||
#define DEBUG_PRINTF(...) do { } while(0) | ||
#endif | ||
#define NYOCI_DEBUG_OUT_FILE stdout | ||
#ifndef DEBUG_PRINTF | ||
#define DEBUG_PRINTF(...) do { } while(0) | ||
#endif | ||
#define NYOCI_DEBUG_OUT_FILE stdout | ||
|
||
#elif defined(__AVR__) | ||
#define NYOCI_DEBUG_OUT_FILE stdout | ||
#define NYOCI_DEBUG_OUT_FILE stdout | ||
|
||
#include <stdio.h> | ||
#include <avr/pgmspace.h> | ||
#define CSTR(x) PSTR(x) | ||
#define DEBUG_PRINTF(...) \ | ||
#include <stdio.h> | ||
#include <avr/pgmspace.h> | ||
#define CSTR(x) PSTR(x) | ||
#define DEBUG_PRINTF(...) \ | ||
do { fprintf_P(NYOCI_DEBUG_OUT_FILE, __VA_ARGS__); fputc( \ | ||
'\n', \ | ||
NYOCI_DEBUG_OUT_FILE); } while(0) | ||
'\n', \ | ||
NYOCI_DEBUG_OUT_FILE); } while(0) | ||
|
||
#else // __AVR__ | ||
#define NYOCI_DEBUG_OUT_FILE stderr | ||
#elif defined(ESP_PLATFORM) | ||
#include <esp_log.h> | ||
#define DEBUG_PRINTF(FMT, ...) ESP_LOGI("nyoci", FMT, ##__VA_ARGS__) | ||
#define NYOCI_DEBUG_OUT_FILE stderr | ||
#define CSTR(x) x | ||
|
||
#include <stdio.h> | ||
#define CSTR(x) (x) | ||
#if ASSERT_MACROS_USES_SYSLOG | ||
#include <syslog.h> | ||
#define DEBUG_PRINTF(...) syslog(7, __VA_ARGS__) | ||
#elif ASSERT_MACROS_USE_VANILLA_PRINTF | ||
#define DEBUG_PRINTF(...) \ | ||
do { printf(__VA_ARGS__); printf("\n"); } while(0) | ||
#else | ||
#define DEBUG_PRINTF(...) \ | ||
do { fprintf(NYOCI_DEBUG_OUT_FILE, __VA_ARGS__); fputc('\n', \ | ||
NYOCI_DEBUG_OUT_FILE); } while(0) | ||
#endif | ||
#define NYOCI_DEBUG_OUT_FILE stderr | ||
|
||
#include <stdio.h> | ||
#define CSTR(x) (x) | ||
#if ASSERT_MACROS_USES_SYSLOG | ||
#include <syslog.h> | ||
#define DEBUG_PRINTF(...) syslog(7, __VA_ARGS__) | ||
#elif ASSERT_MACROS_USE_VANILLA_PRINTF | ||
#define DEBUG_PRINTF(...) \ | ||
do { printf(__VA_ARGS__); printf("\n"); } while(0) | ||
#else | ||
#define DEBUG_PRINTF(...) \ | ||
do { fprintf(NYOCI_DEBUG_OUT_FILE, __VA_ARGS__); fputc('\n', \ | ||
NYOCI_DEBUG_OUT_FILE); } while(0) | ||
#endif | ||
|
||
#endif | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -320,7 +320,7 @@ nyoci_outbound_add_options_up_to_key_( | |
|
||
#if NYOCI_CONF_TRANS_ENABLE_OBSERVING | ||
if ( (self->current_transaction != NULL) | ||
&& (self->current_transaction->flags & NYOCI_TRANSACTION_OBSERVE == NYOCI_TRANSACTION_OBSERVE) | ||
&& ((self->current_transaction->flags & NYOCI_TRANSACTION_OBSERVE) == NYOCI_TRANSACTION_OBSERVE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! Mind pulling this commit out into it's own pull request? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't claim credit -- GCC found it and warned me (but I can't remember which warning flag it was.) |
||
&& (self->outbound.last_option_key < COAP_OPTION_OBSERVE) | ||
&& (key > COAP_OPTION_OBSERVE) | ||
) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like all of the changes in this file, including the
errno
stuff. May be worth spinning out.