@@ -58,18 +58,14 @@ NOTE_C_STATIC const char * i2cNoteQueryLength(uint32_t * available,
58
58
// Send a dummy I2C transaction to prime the Notecard
59
59
const char * err = _I2CReceive (_I2CAddress (), & dummy_buffer , 0 , available );
60
60
if (err ) {
61
- #ifdef ERRDBG
62
61
NOTE_C_LOG_ERROR (err );
63
- #endif
64
62
return err ;
65
63
}
66
64
67
65
// If we've timed out, return an error
68
66
if (timeoutMs && _GetMs () - startMs >= timeoutMs ) {
69
67
const char * err = ERRSTR ("timeout: no response from Notecard {io}" , c_iotimeout );
70
- #ifdef ERRDBG
71
68
NOTE_C_LOG_ERROR (err );
72
- #endif
73
69
return err ;
74
70
}
75
71
}
@@ -119,9 +115,7 @@ const char *i2cNoteTransaction(const char *request, size_t reqLen, char **respon
119
115
uint32_t available = 0 ;
120
116
err = i2cNoteQueryLength (& available , timeoutMs );
121
117
if (err ) {
122
- #ifdef ERRDBG
123
118
NOTE_C_LOG_ERROR (ERRSTR ("failed to query Notecard" , c_err ));
124
- #endif
125
119
_UnlockI2C ();
126
120
return err ;
127
121
}
@@ -131,9 +125,7 @@ const char *i2cNoteTransaction(const char *request, size_t reqLen, char **respon
131
125
jsonbuf = (uint8_t * )_Malloc (jsonbufAllocLen + 1 );
132
126
if (jsonbuf == NULL ) {
133
127
const char * err = ERRSTR ("transaction: jsonbuf malloc failed" , c_mem );
134
- #ifdef ERRDBG
135
128
NOTE_C_LOG_ERROR (err );
136
- #endif
137
129
_UnlockI2C ();
138
130
return err ;
139
131
}
@@ -150,9 +142,7 @@ const char *i2cNoteTransaction(const char *request, size_t reqLen, char **respon
150
142
if (jsonbuf ) {
151
143
_Free (jsonbuf );
152
144
}
153
- #ifdef ERRDBG
154
145
NOTE_C_LOG_ERROR (ERRSTR ("error occured during receive" , c_iobad ));
155
- #endif
156
146
_UnlockI2C ();
157
147
return err ;
158
148
}
@@ -169,9 +159,7 @@ const char *i2cNoteTransaction(const char *request, size_t reqLen, char **respon
169
159
uint8_t * jsonbufNew = (uint8_t * )_Malloc (jsonbufAllocLen + 1 );
170
160
if (jsonbufNew == NULL ) {
171
161
const char * err = ERRSTR ("transaction: jsonbuf grow malloc failed" , c_mem );
172
- #ifdef ERRDBG
173
162
NOTE_C_LOG_ERROR (err );
174
- #endif
175
163
if (jsonbuf ) {
176
164
_Free (jsonbuf );
177
165
}
@@ -368,9 +356,7 @@ const char *i2cChunkedReceive(uint8_t *buffer, uint32_t *size, bool delay, uint3
368
356
const char * err = _I2CReceive (_I2CAddress (), (buffer + received ), requested , available );
369
357
if (err ) {
370
358
* size = received ;
371
- #ifdef ERRDBG
372
359
NOTE_C_LOG_ERROR (err );
373
- #endif
374
360
return err ;
375
361
}
376
362
@@ -414,11 +400,9 @@ const char *i2cChunkedReceive(uint8_t *buffer, uint32_t *size, bool delay, uint3
414
400
// Exit on timeout
415
401
if (timeoutMs && (_GetMs () - startMs >= timeoutMs )) {
416
402
* size = received ;
417
- #ifdef ERRDBG
418
403
if (received ) {
419
404
NOTE_C_LOG_ERROR (ERRSTR ("received only partial reply before timeout" , c_iobad ));
420
405
}
421
- #endif
422
406
return ERRSTR ("timeout: transaction incomplete {io}" , c_iotimeout );
423
407
}
424
408
@@ -461,9 +445,7 @@ const char *i2cChunkedTransmit(uint8_t *buffer, uint32_t size, bool delay)
461
445
estr = _I2CTransmit (_I2CAddress (), chunk , chunkLen );
462
446
if (estr != NULL ) {
463
447
_I2CReset (_I2CAddress ());
464
- #ifdef ERRDBG
465
448
NOTE_C_LOG_ERROR (estr );
466
- #endif
467
449
return estr ;
468
450
}
469
451
chunk += chunkLen ;
0 commit comments