8000 esp32/network_ppp.c: Update callback signature. · micropython/micropython@f312daa · GitHub
[go: up one dir, main page]

Skip to content

Commit f312daa

Browse files
esp32/network_ppp.c: Update callback signature.
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com> Co-Authored-By: Daniel van de Giessen <daniel@dvdgiessen.nl>
1 parent 30a96b3 commit f312daa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ports/esp32/network_ppp.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ static mp_obj_t ppp_make_new(mp_obj_t stream) {
100100
}
101101
MP_DEFINE_CONST_FUN_OBJ_1(esp_network_ppp_make_new_obj, ppp_make_new);
102102

103-
static u32_t ppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx) {
103+
104+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
105+
static u32_t ppp_output_callback(ppp_pcb *pcb, const void *data, u32_t len, void *ctx)
106+
#else
107+
static u32_t ppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx)
108+
#endif
109+
{
104110
ppp_if_obj_t *self = ctx;
105111

106112
mp_obj_t stream = self->stream;
@@ -109,7 +115,7 @@ static u32_t ppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx)
109115
}
110116

111117
int err;
112-
return mp_stream_rw(stream, data, len, &err, MP_STREAM_RW_WRITE);
118+
return mp_stream_rw(stream, (void *)data, len, &err, MP_STREAM_RW_WRITE);
113119
}
114120

115121
static void pppos_client_task(void *self_in) {

0 commit comments

Comments
 (0)
0