// unregister all interrupt sources void uart_deinit(void) { for (int i = 0; i < MP_ARRAY_SIZE(MP_STATE_PORT(pyb_uart_obj_all)); i++) { pyb_uart_obj_t *uart_obj = MP_STATE_PORT(pyb_uart_obj_all)[i]; if (uart_obj != NULL) { pyb_uart_deinit(uart_obj); } } }
// unregister all interrupt sources void uart_deinit(void) { for (int i = PYB_UART_0; i < PYB_NUM_UARTS; i++) { pyb_uart_obj_t *self; if ((self = pyb_uart_find (i))) { pyb_uart_deinit(self); } } }
// unregister all interrupt sources void uart_deinit(void) { for (int i = 0; i < MP_ARRAY_SIZE(pyb_uart_obj_all); i++) { pyb_uart_obj_t *uart_obj = pyb_uart_obj_all[i]; if (uart_obj != NULL) { pyb_uart_deinit(uart_obj); } } }
/// \method delete() /// Deinits the UART and removes its references so that it can be cleaned by the gc STATIC mp_obj_t pyb_uart_delete(mp_obj_t self_in) { pyb_uart_obj_t *self = self_in; // deinit the peripheral pyb_uart_deinit(self); // remove it from the list mp_obj_list_remove(&MP_STATE_PORT(pyb_uart_list), self); return mp_const_none; }