fix keyboard interrupt

This commit is contained in:
Jeff Epler 2021-06-18 11:15:51 -05:00
parent 8647097078
commit e1d7e46e88
4 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char) {
// Compare mp_interrupt_char with wanted_char and ignore if not matched
if (mp_interrupt_char == wanted_char) {
tud_cdc_read_flush(); // flush read fifo
mp_keyboard_interrupt();
mp_sched_keyboard_interrupt();
// CircuitPython's VM is run in a separate FreeRTOS task from TinyUSB.
// So, we must notify the other task when a CTRL-C is received.
xTaskNotifyGive(circuitpython_task);

View File

@ -81,7 +81,7 @@ STATIC void on_ble_evt(ble_evt_t *ble_evt, void *param) {
for (size_t i = 0; i < write->len; ++i) {
#if MICROPY_KBD_EXCEPTION
if (write->data[i] == mp_interrupt_char) {
mp_keyboard_interrupt();
mp_sched_keyboard_interrupt();
} else
#endif
{

View File

@ -355,7 +355,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) {
if (context->sigint_enabled) {
if (context->rx_char == CHAR_CTRL_C) {
common_hal_busio_uart_clear_rx_buffer(context);
mp_keyboard_interrupt();
mp_sched_keyboard_interrupt();
}
}

View File

@ -293,7 +293,7 @@ void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char) {
// Compare mp_interrupt_char with wanted_char and ignore if not matched
if (mp_interrupt_char == wanted_char) {
tud_cdc_n_read_flush(itf); // flush read fifo
mp_keyboard_interrupt();
mp_sched_keyboard_interrupt();
}
}