A few related things I've found that I shall investigate
I'm wondering if https://github.com/espruino/Espruino/blob/31c67baa20302b80aafc5b355aade9028a37c471/targets/nrf5x/bluetooth.c#L1593 is lacking error checking that the sd_ble_gattc_write() was successful, as per https://devzone.nordicsemi.com/f/nordic-q-a/49613/sd_ble_gattc_write-and-ble_gattc_evt_write_rsp - what led me there is trying to follow through how Espruino knows the sd_ble_gattc_write() has completed, in case I can find a way to then write the next value quicker than currently. It looks like there's actually just one BLE-related promise at a time https://github.com/espruino/Espruino/blob/31c67baa20302b80aafc5b355aade9028a37c471/libs/bluetooth/jswrap_bluetooth.c#L90 , but I've not yet spotted how we get through to https://github.com/espruino/Espruino/blob/31c67baa20302b80aafc5b355aade9028a37c471/libs/bluetooth/jswrap_bluetooth.c#L96
sd_ble_gattc_write()
@John started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
A few related things I've found that I shall investigate
I'm wondering if https://github.com/espruino/Espruino/blob/31c67baa20302b80aafc5b355aade9028a37c471/targets/nrf5x/bluetooth.c#L1593 is lacking error checking that the
sd_ble_gattc_write()
was successful, as per https://devzone.nordicsemi.com/f/nordic-q-a/49613/sd_ble_gattc_write-and-ble_gattc_evt_write_rsp - what led me there is trying to follow through how Espruino knows thesd_ble_gattc_write()
has completed, in case I can find a way to then write the next value quicker than currently. It looks like there's actually just one BLE-related promise at a time https://github.com/espruino/Espruino/blob/31c67baa20302b80aafc5b355aade9028a37c471/libs/bluetooth/jswrap_bluetooth.c#L90 , but I've not yet spotted how we get through to https://github.com/espruino/Espruino/blob/31c67baa20302b80aafc5b355aade9028a37c471/libs/bluetooth/jswrap_bluetooth.c#L96