Add UG_2965SWEG01 driver from Darcy Gong; fix logic error in how waiters are reawakened in the USB HID keyboard driver

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5462 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-12-26 20:04:57 +00:00
parent 373e145e54
commit 8ed19bb07d
10 changed files with 1613 additions and 7 deletions
+4
View File
@@ -51,6 +51,10 @@ ifeq ($(CONFIG_LCD_UG2864AMBAG01),y)
CSRCS += ug-2864ambag01.c
endif
ifeq ($(CONFIG_LCD_UG2864HSWEG01),y)
CSRCS += ug-2864hsweg01.c
endif
ifeq ($(CONFIG_LCD_UG9664HSWAG01),y)
CSRCS += ug-9664hswag01.c
endif
File diff suppressed because it is too large Load Diff
+12 -4
View File
@@ -1027,6 +1027,7 @@ static int usbhost_kbdpoll(int argc, char *argv[])
/* Loop here until the device is disconnected */
uvdbg("Entering poll loop\n");
while (!priv->disconnected)
{
/* Make sure that we have exclusive access to the private data
@@ -1169,10 +1170,10 @@ static int usbhost_kbdpoll(int argc, char *argv[])
#endif
}
/* Did we just transition from no data available to data available? */
/* Is there data available? */
newstate = (priv->headndx == priv->tailndx);
if (empty && !newstate)
if (!newstate)
{
/* Yes.. Is there a thread waiting for keyboard data now? */
@@ -1184,9 +1185,15 @@ static int usbhost_kbdpoll(int argc, char *argv[])
priv->waiting = false;
}
/* And wake up any threads waiting for the POLLIN event */
/* Did we just transition from no data available to data
* available? If so, wake up any threads waiting for the
* POLLIN event.
*/
usbhost_pollnotify(priv);
if (empty)
{
usbhost_pollnotify(priv);
}
}
empty = newstate;
@@ -2146,6 +2153,7 @@ static ssize_t usbhost_read(FAR struct file *filep, FAR char *buffer, size_t len
/* Wait for data to be available */
uvdbg("Waiting...\n");
priv->waiting = true;
usbhost_givesem(&priv->exclsem);
usbhost_takesem(&priv->waitsem);