1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Use gcc-built LwIP by default (#1926)

It is still possible to use xcc-built LwIP by selecting "Core Development" board from tools menu.
This commit is contained in:
Ivan Grokhotkov
2016-05-06 20:09:15 +08:00
parent 0b7f8f9773
commit a2b82ed6b6
4 changed files with 11 additions and 34 deletions

View File

@ -29,6 +29,12 @@ typedef void (*discard_cb_t)(void*, ClientContext*);
extern "C" void esp_yield();
extern "C" void esp_schedule();
#ifdef LWIP_OPEN_SRC
typedef err_t recv_ret_t;
#else
typedef int32_t recv_ret_t;
#endif
class ClientContext {
public:
ClientContext(tcp_pcb* pcb, discard_cb_t discard_cb, void* discard_cb_arg) :
@ -269,7 +275,7 @@ class ClientContext {
}
}
int32_t _recv(tcp_pcb* pcb, pbuf* pb, err_t err) {
recv_ret_t _recv(tcp_pcb* pcb, pbuf* pb, err_t err) {
if(pb == 0) // connection closed
{
@ -310,7 +316,7 @@ class ClientContext {
return ERR_OK;
}
static int32_t _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, err_t err) {
static recv_ret_t _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, err_t err) {
return reinterpret_cast<ClientContext*>(arg)->_recv(tpcb, pb, err);
}