Browse Source

lcd4linux: fix endian issues with GLCD2USB plugin

Patch submitted by Vladimir Ermakov.

Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Jonathan McCrohan 9 years ago
parent
commit
e3b0a20c44
2 changed files with 21 additions and 1 deletions
  1. 1
    1
      utils/lcd4linux/Makefile
  2. 20
    0
      utils/lcd4linux/patches/173-glcd2usb-bigendian-fix.patch

+ 1
- 1
utils/lcd4linux/Makefile View File

@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
10 10
 PKG_NAME:=lcd4linux
11 11
 PKG_REV:=1203
12 12
 PKG_VERSION:=r$(PKG_REV)
13
-PKG_RELEASE:=2
13
+PKG_RELEASE:=3
14 14
 
15 15
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 16
 PKG_SOURCE_URL:=https://ssl.bulix.org/svn/lcd4linux/trunk/

+ 20
- 0
utils/lcd4linux/patches/173-glcd2usb-bigendian-fix.patch View File

@@ -0,0 +1,20 @@
1
+--- a/drv_GLCD2USB.c
2
++++ b/drv_GLCD2USB.c
3
+@@ -48,6 +48,7 @@
4
+ #include <fcntl.h>
5
+ #include <sys/time.h>
6
+ #include <usb.h>
7
++#include <endian.h>
8
+ 
9
+ #include "debug.h"
10
+ #include "cfg.h"
11
+@@ -487,6 +488,9 @@ static int drv_GLCD2USB_start(const char
12
+ 	return -1;
13
+     }
14
+ 
15
++    buffer.display_info.width = le16toh(buffer.display_info.width);
16
++    buffer.display_info.height = le16toh(buffer.display_info.height);
17
++
18
+     info("%s: display name = %s", Name, buffer.display_info.name);
19
+     info("%s: display resolution = %d * %d", Name, buffer.display_info.width, buffer.display_info.height);
20
+     info("%s: display flags: %x", Name, buffer.display_info.flags);