diff options
author | mzuther <mzuther@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2010-02-14 12:05:58 +0000 |
---|---|---|
committer | mzuther <mzuther@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2010-02-14 12:05:58 +0000 |
commit | 3d85ed2b1731a7bef0f57fe6d70136c4f9fa6cc5 (patch) | |
tree | 42b342c37a53886a83008489a9e69d1ce9f6ea2f | |
parent | 3c4915845fd50fe5c5b1591f505df3cf60473f51 (diff) | |
download | lcd4linux-3d85ed2b1731a7bef0f57fe6d70136c4f9fa6cc5.tar.gz |
drv_picoLCDGraphic.c: added configuration for USB read timeout
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1113 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r-- | drv_picoLCDGraphic.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drv_picoLCDGraphic.c b/drv_picoLCDGraphic.c index afbc61f..f136a79 100644 --- a/drv_picoLCDGraphic.c +++ b/drv_picoLCDGraphic.c @@ -92,6 +92,10 @@ static int dirty = 1; /* timer for display redraw (set to zero for "direct updates") */ static int update = 0; +/* USB read timeout in ms (the picoLCD 256x64 times out on every read + unless a key has been pressed!) */ +static int read_timeout = 0; + static char Name[] = "picoLCDGraphic"; static unsigned char *pLG_framebuffer; @@ -178,7 +182,7 @@ static int drv_pLG_open(void) static int drv_pLG_read(unsigned char *data, int size) { - return usb_interrupt_read(lcd, USB_ENDPOINT_IN + 1, (char *) data, size, 1000); + return usb_interrupt_read(lcd, USB_ENDPOINT_IN + 1, (char *) data, size, read_timeout); } @@ -465,6 +469,10 @@ static int drv_pLG_start(const char *section, const int quiet) /* set display redraw interval (set to zero for "direct updates") */ cfg_number(section, "update", 200, 0, -1, &update); + /* USB read timeout in ms (the picoLCD 256x64 times out on every + read unless a key has been pressed!) */ + cfg_number(section, "Timeout", 5, 0, -1, &read_timeout); + s = cfg_get(section, "Size", NULL); if (s == NULL || *s == '\0') { error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); |