|
15 | 15 | */ |
16 | 16 |
|
17 | 17 | #if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_PRESENT) |
| 18 | +#ifndef __STDC_FORMAT_MACROS |
| 19 | +#define __STDC_FORMAT_MACROS |
| 20 | +#endif |
| 21 | +#include <inttypes.h> |
| 22 | + |
18 | 23 | #include <string.h> |
19 | | -#include <stdint.h> |
20 | 24 | #include <stdlib.h> |
21 | 25 |
|
22 | 26 | #include "ESP8266.h" |
@@ -601,7 +605,7 @@ nsapi_error_t ESP8266::send(int id, const void *data, uint32_t amount) |
601 | 605 | set_timeout(ESP8266_SEND_TIMEOUT); |
602 | 606 | _busy = false; |
603 | 607 | _error = false; |
604 | | - if (!_parser.send("AT+CIPSEND=%d,%lu", id, amount)) { |
| 608 | + if (!_parser.send("AT+CIPSEND=%d,%" PRIu32, id, amount)) { |
605 | 609 | tr_debug("ESP8266::send(): AT+CIPSEND failed"); |
606 | 610 | goto END; |
607 | 611 | } |
@@ -734,7 +738,7 @@ int32_t ESP8266::_recv_tcp_passive(int id, void *data, uint32_t amount, uint32_t |
734 | 738 | amount = amount > 2048 ? 2048 : amount; |
735 | 739 |
|
736 | 740 | // NOTE: documentation v3.0 says '+CIPRECVDATA:<data_len>,' but it's not how the FW responds... |
737 | | - bool done = _parser.send("AT+CIPRECVDATA=%d,%lu", id, amount) |
| 741 | + bool done = _parser.send("AT+CIPRECVDATA=%d,%" PRIu32, id, amount) |
738 | 742 | && _parser.recv("OK\n"); |
739 | 743 |
|
740 | 744 | _sock_i[id].tcp_data = NULL; |
@@ -1056,7 +1060,7 @@ void ESP8266::_oob_tcp_data_hdlr() |
1056 | 1060 |
|
1057 | 1061 | MBED_ASSERT(_sock_active_id >= 0 && _sock_active_id < 5); |
1058 | 1062 |
|
1059 | | - if (!_parser.recv("%ld:", &len)) { |
| 1063 | + if (!_parser.recv("%" SCNd32 ":", &len)) { |
1060 | 1064 | return; |
1061 | 1065 | } |
1062 | 1066 |
|
|
0 commit comments