diff options
author | Michal Simek <michal.simek@xilinx.com> | 2018-06-27 14:16:54 +0200 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2018-07-19 10:49:53 +0200 |
commit | f8f3e0e539e08da381e397ba58fcc2df195ae2ec (patch) | |
tree | 898aa3aa543ff0aca37a821d7ebabb4b7484373a | |
parent | b4f015845a5814ab56aee136bf2c7175c205c6c2 (diff) | |
download | u-boot-f8f3e0e539e08da381e397ba58fcc2df195ae2ec.zip u-boot-f8f3e0e539e08da381e397ba58fcc2df195ae2ec.tar.gz u-boot-f8f3e0e539e08da381e397ba58fcc2df195ae2ec.tar.bz2 |
usb_kbd: Add support for watchdog
There is need to service watchdog in while loop or system will be
restarted when idlying.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
-rw-r--r-- | common/usb_kbd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 8b2fccf..406bd37 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -13,6 +13,7 @@ #include <malloc.h> #include <memalign.h> #include <stdio_dev.h> +#include <watchdog.h> #include <asm/byteorder.h> #include <usb.h> @@ -387,8 +388,10 @@ static int usb_kbd_getc(struct stdio_dev *sdev) usb_kbd_dev = (struct usb_device *)dev->priv; data = usb_kbd_dev->privptr; - while (data->usb_in_pointer == data->usb_out_pointer) + while (data->usb_in_pointer == data->usb_out_pointer) { + WATCHDOG_RESET(); usb_kbd_poll_for_event(usb_kbd_dev); + } if (data->usb_out_pointer == USB_KBD_BUFFER_LEN - 1) data->usb_out_pointer = 0; |