aboutsummaryrefslogtreecommitdiffstats
-39/+604
AgeCommit message (Collapse)AuthorFilesLines
2010-01-21include config.h in *every* source filemichael4-0/+10
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1091 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-20X11 driver: do not display key strokes that do not map to a buttonmzuther1-14/+18
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1090 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-20indent.sh: ignore indentation profiles, so things are not messed up accidentallymzuther1-1/+2
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1089 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-20X11 driver: handle key presses (arrows, RET and ESC) in addition to clicks ↵mzuther1-2/+72
on the GUI buttons git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1088 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-19included "config.h" in "plugin.h" and changed "plugin.c" and ↵mzuther3-10/+6
"plugin_sample.c" accordingly git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1087 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-19plugin_python.c: print tracebacks also for Python scripts that do not "compile"mzuther1-0/+2
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1086 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-19plugin_python.c: print Python tracebacks on stderr (yay!)mzuther1-0/+2
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1085 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-19fixed compile error by including "config.h" in "plugin_python.c"mzuther1-0/+1
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1084 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-18support for 'aligned pingpong' by Martin Zuthermichael2-10/+44
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1083 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-17use own strndup() from evaluator if not available on systemvolker2-5/+6
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1082 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-17fixed typovolker1-1/+1
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1081 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-17fixed memory leak in using strdup() instead of strdupa()volker1-0/+6
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1080 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-15Ticket 182volker3-21/+31
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1079 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-15strdupa uses alloca which is not available everywhere. strdup is used insteadvolker1-2/+2
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1078 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-05plugins work on MacOS X: proc_stat, cpuinfovolker4-7/+87
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1077 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-03linker error with LW_ABP correctedmichael2-14/+16
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1076 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2010-01-03update to autoconf 2.65michael3-328/+403
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1075 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-22indentationmichael1-1/+1
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1074 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-22indentationmichael1-0/+1
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1073 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-22add event.h to extra sourcesmichael1-1/+1
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1072 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-22Logic Way ABP08 ABP09 enhancements by Arndt Kritznermichael1-7/+141
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1071 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-21Remove warnings from mpris pluginedman0072-5/+4
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1070 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-21Fix the dbus/pkg-config confgure (Now the configure script will probably ↵edman0072-2/+12
require pkg-config to be installed) Defines to compile the dbus plugin are now properly set git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1069 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-21* Fix segfault on shutdown in drv_picoLCDGraphic.cedman0072-2/+8
* Prevent dbus from exiting the program when compiled with -DDEBUG git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1068 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-20special commandline parameters for X11volker4-3/+56
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1067 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-19Make the dbus plugin shutdown without showing dbus leaks when compiled with ↵edman0072-10/+12
-DDEBUG git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1066 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1053 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-10Logic Way patch from Arndt Kritznermichael1-15/+9
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1052 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-05added protocol details to PICGraphic driver, fixed typos is generic headerspeterbailey3-30/+80
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1051 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-03updating Makefile.am for PICGraphic driver, reverting mistaken commit of ↵peterbailey2-61/+137
aclocal.m4 git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1050 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-03adding PICGraphic driverpeterbailey5-138/+506
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1049 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-02svn_version bumped upmichael1-1/+1
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1048 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-11-01Logic Way GmbH ABP08 ABP09 enhancements by Arndt Kritznermichael1-25/+236
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1047 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-10-19driver for Logic Way GmbH ABP08 (serial) and ABP09 (USB) appliance control ↵michael9-17/+401
panels by Arndt Kritzner git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1046 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-09-25additional debug outputvolker3-9/+39
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1045 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-09-23autoconf patches from PT M.michael11-9104/+17487
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1044 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-09-23indentationmichael1-4/+4
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1043 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2009-09-23indentationmichael1-1/+2
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1042 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
span class="p">{ buffer[j++] = data[i]; } } if (j > 0) { drv_generic_serial_write(buffer, j); } } static void drv_PHAnderson_clear(void) { char cmd[2]; cmd[0] = '?'; cmd[1] = 'f'; drv_PHAnderson_send(cmd, 2); } static void drv_PHAnderson_write(const int row, const int col, const char *data, int len) { char cmd[7]; cmd[0] = '?'; cmd[1] = 'y'; cmd[2] = row + '0'; cmd[3] = '?'; cmd[4] = 'x'; cmd[5] = col / 10 + '0'; cmd[6] = col % 10 + '0'; drv_PHAnderson_send(cmd, 7); drv_PHAnderson_send(data, len); } static void drv_PHAnderson_defchar(const int ascii, const unsigned char *matrix) { char cmd[19]; int i; cmd[0] = '?'; cmd[1] = 'D'; cmd[2] = ascii + '0'; for (i = 0; i < 8; i++) { cmd[i * 2 + 3] = ((matrix[i] >> 4) & 1) + '0'; cmd[i * 2 + 4] = (((matrix[i] & 0x0F) < 10) ? (matrix[i] & 0x0F) + '0' : (matrix[i] & 0x0F) + '7'); } drv_PHAnderson_send(cmd, 19); udelay(T_WRITE); } static int drv_PHAnderson_blacklight(int blacklight) { char cmd[4]; if (blacklight < 0) blacklight = 0; if (blacklight > 255) blacklight = 255; cmd[0] = '?'; cmd[1] = 'B'; cmd[2] = (((blacklight >> 4) < 10) ? (blacklight >> 4) + '0' : (blacklight >> 4) + '7'); cmd[3] = (((blacklight & 0x0F) < 10) ? (blacklight & 0x0F) + '0' : (blacklight & 0x0F) + '7'); drv_PHAnderson_send(cmd, 4); udelay(T_WRITE); return blacklight; } static int drv_PHAnderson_bootscreen(const char *bootmsg) { char cmd[255]; int i, j, k; i = 0; j = 0; k = 0; if (bootmsg == NULL || *bootmsg == '\0') { cmd[0] = '?'; cmd[1] = 'S'; cmd[2] = '0'; drv_PHAnderson_send(cmd, 3); udelay(T_WRITE); } else { cmd[0] = '?'; cmd[1] = 'S'; cmd[2] = '2'; drv_PHAnderson_send(cmd, 3); udelay(T_WRITE); cmd[0] = '?'; cmd[1] = 'C'; for (i = 0; i < DROWS; i++) { cmd[2] = '0' + i; for (k = 0; k < DCOLS; k++) { if (bootmsg[j] != '\0') { cmd[3 + k] = bootmsg[j]; j++; } else { cmd[3 + k] = ' '; } } drv_PHAnderson_send(cmd, k + 3); udelay(T_BOOT); } } return j; } static int drv_PHAnderson_start(const char *section) { int blacklight; int rows = -1, cols = -1; char *s; char cmd[255]; s = cfg_get(section, "Size", NULL); if (s == NULL || *s == '\0') { error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); return -1; } if (sscanf(s, "%dx%d", &cols, &rows) != 2 || rows < 1 || cols < 1) { error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); free(s); return -1; } DROWS = rows; DCOLS = cols; /* PHAnderson execution timings [milliseconds] * we use the worst-case default values, but allow * modification from the config file. */ T_WRITE = timing(Name, section, "WRITE", 170, "ms") * 1000; /* write eeprom time */ T_READ = timing(Name, section, "READ", 10, "ms") * 1000; /* read eeprom time */ T_BOOT = timing(Name, section, "BOOT", 300, "ms") * 1000; /* boot screen write eeprom time */ if (drv_PHAnderson_open(section) < 0) { return -1; } /* Define screen size */ cmd[0] = '?'; cmd[1] = 'G'; cmd[2] = rows + '0'; cmd[3] = (cols / 10) + '0'; cmd[4] = (cols % 10) + '0'; drv_PHAnderson_send(cmd, 5); udelay(T_WRITE); /* Hide cursor */ cmd[0] = '?'; cmd[1] = 'c'; cmd[2] = '0'; drv_PHAnderson_send(cmd, 3); udelay(T_WRITE); if (cfg_number(section, "Blacklight", 0, 0, 255, &blacklight) > 0) { drv_PHAnderson_blacklight(blacklight); } s = cfg_get(section, "Bootscreen", NULL); printf(s); drv_PHAnderson_bootscreen(s); drv_PHAnderson_clear(); /* clear display */ return 0; } /****************************************/ /*** plugins ***/ /****************************************/ static void plugin_blacklight(RESULT * result, RESULT * arg1) { double blacklight; blacklight = drv_PHAnderson_blacklight(R2N(arg1)); SetResult(&result, R_NUMBER, &blacklight); } static void plugin_bootscreen(RESULT * result, RESULT * arg1) { double bootmsg; bootmsg = drv_PHAnderson_bootscreen(R2S(arg1)); SetResult(&result, R_NUMBER, &bootmsg); } /****************************************/ /*** widget callbacks ***/ /****************************************/ /* using drv_generic_text_draw(W) */ /* using drv_generic_text_icon_draw(W) */ /* using drv_generic_text_bar_draw(W) */ /****************************************/ /*** exported functions ***/ /****************************************/ /* list models */ int drv_PHAnderson_list(void) { printf("PHAnderson serial-to-HD44780 adapter"); return 0; } int drv_PHAnderson_init(const char *section, const int quiet) { WIDGET_CLASS wc; int ret; info("%s: %s", Name, "$Rev: 840 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ YRES = 8; /* pixel height of one char */ CHARS = 8; /* number of user-defineable characters */ CHAR0 = 0; /* ASCII of first user-defineable char */ GOTO_COST = 7; /* number of bytes a goto command requires */ /* real worker functions */ drv_generic_text_real_write = drv_PHAnderson_write; drv_generic_text_real_defchar = drv_PHAnderson_defchar; /* start display */ if ((ret = drv_PHAnderson_start(section)) != 0) return ret; if (!quiet) { char buffer[40]; qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); if (drv_generic_text_greet(buffer, "www.bwct.de")) { sleep(3); drv_PHAnderson_clear(); } } /* initialize generic text driver */ if ((ret = drv_generic_text_init(section, Name)) != 0) return ret; /* initialize generic icon driver */ if ((ret = drv_generic_text_icon_init()) != 0) return ret; /* initialize generic bar driver */ if ((ret = drv_generic_text_bar_init(0)) != 0) return ret; /* add fixed chars to the bar driver */ drv_generic_text_bar_add_segment(0, 0, 0, 32); /* ASCII 32 = blank */ /* register text widget */ wc = Widget_Text; wc.draw = drv_generic_text_draw; widget_register(&wc); /* register icon widget */ wc = Widget_Icon; wc.draw = drv_generic_text_icon_draw; widget_register(&wc); /* register bar widget */ wc = Widget_Bar; wc.draw = drv_generic_text_bar_draw; widget_register(&wc); /* register plugins */ AddFunction("LCD::blacklight", 1, plugin_blacklight); AddFunction("LCD::bootscreen", 1, plugin_bootscreen); return 0; } int drv_PHAnderson_quit(const int quiet) { info("%s: shutting down.", Name); drv_generic_text_quit(); drv_PHAnderson_clear(); /* say goodbye... */ if (!quiet) { drv_generic_text_greet("goodbye!", NULL); } debug("closing connection"); drv_PHAnderson_close(); return (0); } DRIVER drv_PHAnderson = { .name = Name, .list = drv_PHAnderson_list, .init = drv_PHAnderson_init, .quit = drv_PHAnderson_quit, };