kopia lustrzana https://github.com/micropython/micropython
47d02b3104
If the _IRQ_L2CAP_RECV handler does the actual consumption of the incoming data (i.e. via l2cap_recvinto), rather than setting a flag for non-scheduler-context to handle it later, then two things can happen: - It can starve the VM (i.e. the scheduled task never terminates). This is because calling l2cap_recvinto will empty the rx buffer, which will grant more credits to the channel (an HCI command), meaning more data can arrive. This means that the loop in hal_uart.c that keeps reading HCI data from the uart and executing NimBLE events as they are created will not terminate, preventing other VM code from running. - There's no flow control (i.e. data will arrive too quickly). The channel shouldn't be given credits until after we return from scheduler context. It's preferable that no work is done in scheduler/IRQ context. But to prevent this being a problem this commit changes l2cap_recvinto so that if it is called in IRQ context, and the Python handler empties the rx buffer, then don't grant credits until the Python handler is complete. Signed-off-by: Jim Mussared <jim.mussared@gmail.com> |
||
---|---|---|
.. | ||
axtls-include | ||
btstack | ||
crypto-algorithms | ||
lwip-include | ||
nimble | ||
re1.5 | ||
uasyncio | ||
uzlib | ||
webrepl | ||
extmod.mk | ||
machine_i2c.c | ||
machine_i2c.h | ||
machine_mem.c | ||
machine_mem.h | ||
machine_pinbase.c | ||
machine_pinbase.h | ||
machine_pulse.c | ||
machine_pulse.h | ||
machine_signal.c | ||
machine_signal.h | ||
machine_spi.c | ||
machine_spi.h | ||
misc.h | ||
modbluetooth.c | ||
modbluetooth.h | ||
modbtree.c | ||
modframebuf.c | ||
modlwip.c | ||
modonewire.c | ||
moduasyncio.c | ||
modubinascii.c | ||
moducryptolib.c | ||
moductypes.c | ||
moduhashlib.c | ||
moduheapq.c | ||
modujson.c | ||
modurandom.c | ||
modure.c | ||
moduselect.c | ||
modussl_axtls.c | ||
modussl_mbedtls.c | ||
modutimeq.c | ||
moduwebsocket.c | ||
moduwebsocket.h | ||
moduzlib.c | ||
modwebrepl.c | ||
mpbthci.c | ||
mpbthci.h | ||
network_cyw43.c | ||
network_cyw43.h | ||
uos_dupterm.c | ||
utime_mphal.c | ||
utime_mphal.h | ||
vfs.c | ||
vfs.h | ||
vfs_blockdev.c | ||
vfs_fat.c | ||
vfs_fat.h | ||
vfs_fat_diskio.c | ||
vfs_fat_file.c | ||
vfs_lfs.c | ||
vfs_lfs.h | ||
vfs_lfsx.c | ||
vfs_lfsx_file.c | ||
vfs_posix.c | ||
vfs_posix.h | ||
vfs_posix_file.c | ||
vfs_reader.c | ||
virtpin.c | ||
virtpin.h |