#! /bin/sh /usr/share/dpatch/dpatch-run ## 03_budget_ci_loadkeys.dpatch by Thomas Schmidt ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: adds the utility budget_ci_loadkeys @DPATCH@ diff -urNad linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c /tmp/dpep.HGK2iu/linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c --- linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c 2004-05-14 12:32:12.000000000 +0200 +++ /tmp/dpep.HGK2iu/linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c 2004-10-16 09:59:28.000000000 +0200 @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -99,12 +100,20 @@ +#ifdef HW_MSP430 +const char usage [] = "\n\tusage: budget_ci_loadkeys keymap_filename.rc5\n\n"; +#else const char usage [] = "\n\tusage: av7110_loadkeys [-i|--invert] [-a|--address ] keymap_filename.(rc5|rcmm)\n\n"; - +#endif struct ir_setup { +#ifdef HW_MSP430 +#define KEYTAB_SIZE 64 +#else +#define KEYTAB_SIZE 256 __u32 ir_config; - __u16 keytab [256]; +#endif + __u16 keytab [KEYTAB_SIZE]; } __attribute__ ((packed)); @@ -116,7 +125,10 @@ char *buf, *pos, *fname = NULL; for (i=1; i 0xff) { - const char msg [] = - "\nERROR: key must be in range 0 ... 0xff!\n\n"; + if (key < 0 || key >= KEYTAB_SIZE) { + char *msg; + asprintf (&msg, + "\nERROR: key must be in range 0 ... 0x%02x!\n\n", + KEYTAB_SIZE); write (0, msg, strlen(msg)); exit (-1); @@ -178,7 +202,7 @@ munmap (buf, len); close (fd); - write (1, &setup, 4 + 256 * sizeof(__u16)); + write (1, &setup, sizeof (setup)); return 0; } diff -urNad linuxtv-dvb-apps/util/av7110_loadkeys/Makefile /tmp/dpep.HGK2iu/linuxtv-dvb-apps/util/av7110_loadkeys/Makefile --- linuxtv-dvb-apps/util/av7110_loadkeys/Makefile 2004-05-14 12:32:12.000000000 +0200 +++ /tmp/dpep.HGK2iu/linuxtv-dvb-apps/util/av7110_loadkeys/Makefile 2004-10-16 09:59:27.000000000 +0200 @@ -1,14 +1,23 @@ CC = gcc -CFLAGS = -g -Wall -O2 +CFLAGS = -g -Wall -O2 -D_GNU_SOURCE -all: av7110_loadkeys evtest +all: av7110_loadkeys budget_ci_loadkeys evtest av7110_loadkeys: av7110_loadkeys.o +budget_ci_loadkeys: budget_ci_loadkeys.o + evtest: evtest.o +av7110_loadkeys.o: CFLAGS += -UHW_MSP430 av7110_loadkeys.o: av7110_loadkeys.c input_keynames.h +budget_ci_loadkeys.c: av7110_loadkeys.c + ln av7110_loadkeys.c budget_ci_loadkeys.c + +budget_ci_loadkeys.o: CFLAGS += -DHW_MSP430 +budget_ci_loadkeys.o: budget_ci_loadkeys.c input_keynames.h + evtest.o: evtest.c input_keynames.h @@ -44,5 +53,6 @@ clean: - $(RM) core* *.o input_keynames.h av7110_loadkeys evtest + $(RM) core* *.o input_keynames.h av7110_loadkeys budget_ci_loadkeys \ + budget_ci_loadkeys.c evtest