@@ -181,10 +181,9 @@ void ESP8266Interface::_connect_async()
181
181
} else {
182
182
// Postpone to give other stuff time to run
183
183
_connect_event_id = _global_event_queue->call_in (ESP8266_CONNECT_TIMEOUT, callback (this , &ESP8266Interface::_connect_async));
184
-
185
184
if (!_connect_event_id) {
186
185
MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \
187
- " _connect_async(): unable to add event to queue" );
186
+ " ESP8266Interface:: _connect_async(): unable to add event to queue. Increase \" events.shared-eventsize \"\n " );
188
187
}
189
188
}
190
189
_cmutex.unlock ();
@@ -228,7 +227,7 @@ int ESP8266Interface::connect()
228
227
229
228
if (!_connect_event_id) {
230
229
MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \
231
- " connect(): unable to add event to queue" );
230
+ " connect(): unable to add event to queue. Increase \" events.shared-eventsize \"\n " );
232
231
}
233
232
234
233
while (_if_blocking && (_conn_status_to_error () != NSAPI_ERROR_IS_CONNECTED)
@@ -586,7 +585,11 @@ int ESP8266Interface::socket_send(void *handle, const void *data, unsigned size)
586
585
&& socket->proto == NSAPI_TCP
587
586
&& core_util_atomic_cas_u8 (&_cbs[socket->id ].deferred , &expect_false, true )) {
588
587
tr_debug (" Postponing SIGIO from the device" );
589
- _global_event_queue->call_in (50 , callback (this , &ESP8266Interface::event_deferred));
588
+ if (!_global_event_queue->call_in (50 , callback (this , &ESP8266Interface::event_deferred))) {
589
+ MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \
590
+ " socket_send(): unable to add event to queue. Increase \" events.shared-eventsize\"\n " );
591
+ }
592
+
590
593
} else if (status == NSAPI_ERROR_WOULD_BLOCK && socket->proto == NSAPI_UDP) {
591
594
status = NSAPI_ERROR_DEVICE_ERROR;
592
595
}
@@ -736,6 +739,10 @@ void ESP8266Interface::event()
736
739
if (!_oob_event_id) {
737
740
// Throttles event creation by using arbitrary small delay
738
741
_oob_event_id = _global_event_queue->call_in (50 , callback (this , &ESP8266Interface::proc_oob_evnt));
742
+ if (!_oob_event_id) {
743
+ MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMEM), \
744
+ " ESP8266Interface::event(): unable to add event to queue. Increase \" events.shared-eventsize\"\n " );
745
+ }
739
746
}
740
747
741
748
for (int i = 0 ; i < ESP8266_SOCKET_COUNT; i++) {
0 commit comments