int do_usbpoll (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { u32 i = 500; int ret = 0; if(argc < 2) goto usage; stop_polling = 0; xfer_error = 0; dfu_load_addr = (ulong)simple_strtoul(argv[1], NULL, 16); while(!stop_polling && (!xfer_error)) { usbtty_poll(); } /* do usbtty_poll() for the DFU Class status request to complete */ while(i && (!xfer_error)) { usbtty_poll(); i--; } return 0; usage: cmd_usage(cmdtp); return 0; }
char NS16550_getc (NS16550_t com_port) { while ((com_port->lsr & LSR_DR) == 0) { #ifdef CONFIG_USB_TTY extern void usbtty_poll(void); usbtty_poll(); #endif } return (com_port->rbr); }
char NS16550_getc(NS16550_t com_port) { while ((serial_in(&com_port->lsr) & UART_LSR_DR) == 0) { #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_USB_TTY) extern void usbtty_poll(void); usbtty_poll(); #endif WATCHDOG_RESET(); } return serial_in(&com_port->rbr); }
char NS16550_getc (NS16550_t com_port) { volatile int time_out = 100000; while ((serial_in(&com_port->lsr) & UART_LSR_DR) == 0) { if (time_out-- <= 0) return 0; #ifdef CONFIG_USB_TTY extern void usbtty_poll(void); usbtty_poll(); #endif WATCHDOG_RESET(); } return serial_in(&com_port->rbr); }