? .Makefile.linux.swp ? spokepov ? resc/clkprobe.png.h ? resc/dataprobe.png.h ? resc/parrconnect.png.h ? resc/parrprobe2.png.h ? resc/parrprobe4.png.h ? resc/parrprobe5.png.h ? resc/resetprobe.png.h ? resc/serialprobe3.png.h ? resc/serialprobe4.png.h ? resc/serialprobe7.png.h Index: Makefile.linux =================================================================== RCS file: Makefile.linux diff -N Makefile.linux --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Makefile.linux 30 Sep 2007 07:21:05 -0000 @@ -0,0 +1,96 @@ +# SpokePOV Makefile for Linux. +# +# Usage: +# +# cd wxsoft +# make -f Makefile.linux +# ./spokepov +# +# Necessary packages: +# +# libusb from http://libusb.sourceforge.net/ +# wxGTK from http://www.wxwidgets.org/ +# libgtk from http://www.gtk.org/ +# +# wxGTK *must* be built with these configure flags: +# ./configure --disable-gtk2 --disable-unicode --enable-monolithic +# +# The default Debian distribution of libgtk-dev, at least, is not configured +# this way - it is build with --enable-unicode, which will break compilation of +# SpokePOV. +# +# Also, make sure wxGTK and libusb are in your LD_LIBRARY_PATH: +# +# export LD_LIBRARY_PATH=/usr/local/lib +# +# Status: +# - Read / Write / Verify over serial tested and works. +# - USB and parallel untested. +# - Import from BMP tested and works. +# - "Test Port" *does not* work. +# - Setting Comm delay does not appear to make a difference in speed. +# - There is a bug where the 'Port' sub-menu will appear several times. + + +srcdir = .. +LDFLAGS_GUI = `wx-config --libs` +CXX = g++ +CXXFLAGS = -ggdb -O0 -Wall -Wundef -Wno-ctor-dtor-privacy +CPPFLAGS = `wx-config --cxxflags` +LDFLAGS = -L. -lusb +TOOLKIT = GTK + +EXTRALIBS = `wx-config --libs` -lusb + +### Variables: ### + +SPOKEPOV_CXXFLAGS = -D__WX$(TOOLKIT)__ \ + -I$(srcdir) $(CPPFLAGS) $(CXXFLAGS) +SPOKEPOV_OBJECTS = \ + spokepov.o wheelpanel.o serbb_posix.o communication.o imagemessagebox.o + + +### Targets: ### + +all: spokepov$(EXEEXT) data + +install: all + +uninstall: + +install-strip: install + +clean: + rm -rf ./.deps ./.pch + rm -f ./*.o + rm -f spokepov$(EXEEXT) + rm -rf spokepov.app + +distclean: clean + rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile + +spokepov$(EXEEXT): $(SPOKEPOV_OBJECTS) + $(CXX) -o $@ $(SPOKEPOV_OBJECTS) $(LDFLAGS) $(LDFLAGS_GUI) $(SAMPLES_RPATH_FLAG) $(__WXLIB_MEDIA_p) $(__WXLIB_ADV_p) $(PLUGIN_ADV_EXTRALIBS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(EXTRALIBS_FOR_GUI) + $(SAMPLES_RPATH_POSTLINK) + +data: + @mkdir -p . + @for f in ; do \ + if test ! -f ./$$f -a ! -d ./$$f ; \ + then x=yep ; \ + else x=`find $(srcdir)/$$f -newer ./$$f -print` ; \ + fi; \ + case "$$x" in ?*) \ + cp -pRf $(srcdir)/$$f . ;; \ + esac; \ + done + + +%.o: $(srcdir)/%.cpp + $(CXXC) -c -o $@ $(SPOKEPOV_CXXFLAGS) $< + + +# Include dependency info, if present: +-include .deps/*.d + +.PHONY: all install uninstall clean distclean spokepov_bundle data Index: communication.h =================================================================== RCS file: /cvsroot/spokepov/wxsoft/communication.h,v retrieving revision 1.3 diff -u -d -r1.3 communication.h --- communication.h 17 Jul 2007 22:15:04 -0000 1.3 +++ communication.h 30 Sep 2007 07:21:05 -0000 @@ -1,4 +1,4 @@ -#include "/usr/local/include/usb.h" +#include enum { SERIAL=1, PARALLEL, USB}; Index: imagemessagebox.cpp =================================================================== RCS file: /cvsroot/spokepov/wxsoft/imagemessagebox.cpp,v retrieving revision 1.1 diff -u -d -r1.1 imagemessagebox.cpp --- imagemessagebox.cpp 18 Feb 2007 06:11:30 -0000 1.1 +++ imagemessagebox.cpp 30 Sep 2007 07:21:05 -0000 @@ -1,6 +1,8 @@ +#include #include #include #include +#include #include "imagemessagebox.h" BEGIN_EVENT_TABLE(ImageMessageBox, wxDialog ) Index: serbb_posix.c =================================================================== RCS file: serbb_posix.c diff -N serbb_posix.c --- serbb_posix.c 18 Feb 2007 06:11:30 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,271 +0,0 @@ -/* - * avrdude - A Downloader/Uploader for AVR device programmers - * Copyright (C) 2000, 2001, 2002, 2003 Brian S. Dean - * Copyright (C) 2005 Michael Holzt - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -/* $Id: serbb_posix.c,v 1.1 2007/02/18 06:11:30 lady_ada Exp $ */ - -/* - * Posix serial bitbanging interface for avrdude. - */ - -#if !defined(WIN32NATIVE) - -#include "ac_cfg.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "avr.h" -#include "pindefs.h" -#include "pgm.h" -#include "bitbang.h" - -#undef DEBUG - -extern char *progname; -struct termios oldmode; - -/* - serial port/pin mapping - - 1 cd <- - 2 rxd <- - 3 txd -> - 4 dtr -> - 5 dsr <- - 6 rts -> - 7 cts <- -*/ - -static int serregbits[] = -{ TIOCM_CD, 0, 0, TIOCM_DTR, TIOCM_DSR, TIOCM_RTS, TIOCM_CTS }; - -#ifdef DEBUG -static char *serpins[7] = - { "CD", "RXD", "TXD ~RESET", "DTR MOSI", "DSR", "RTS SCK", "CTS MISO" }; -#endif - -static int serbb_setpin(PROGRAMMER * pgm, int pin, int value) -{ - unsigned int ctl; - - if (pin & PIN_INVERSE) - { - value = !value; - pin &= PIN_MASK; - } - - if ( pin < 1 || pin > 7 ) - return -1; - - pin--; - -#ifdef DEBUG - printf("%s to %d\n",serpins[pin],value); -#endif - usleep(pgm->bb_delay); - - switch ( pin ) - { - case 2: /* txd */ - ioctl(pgm->fd, value ? TIOCSBRK : TIOCCBRK, 0); - return 0; - - case 3: /* dtr, rts */ - case 5: ioctl(pgm->fd, TIOCMGET, &ctl); - if ( value ) - ctl |= serregbits[pin]; - else - ctl &= ~(serregbits[pin]); - ioctl(pgm->fd, TIOCMSET, &ctl); - return 0; - - default: /* impossible */ - return -1; - } -} - -static int serbb_getpin(PROGRAMMER * pgm, int pin) -{ - unsigned int ctl; - unsigned char invert; - - if (pin & PIN_INVERSE) - { - invert = 1; - pin &= PIN_MASK; - } else - invert = 0; - - if ( pin < 1 || pin > 7 ) - return(-1); - - pin --; - - switch ( pin ) - { - case 1: /* rxd, currently not implemented, FIXME */ - return(-1); - - case 0: /* cd, dsr, dtr, rts, cts */ - case 3: - case 4: - case 5: - case 6: ioctl(pgm->fd, TIOCMGET, &ctl); - if ( !invert ) - { -#ifdef DEBUG - printf("%s is %d\n",serpins[pin],(ctl & serregbits[pin]) ? 1 : 0 ); -#endif - return ( (ctl & serregbits[pin]) ? 1 : 0 ); - } - else - { -#ifdef DEBUG - printf("%s is %d (~)\n",serpins[pin],(ctl & serregbits[pin]) ? 0 : 1 ); -#endif - return (( ctl & serregbits[pin]) ? 0 : 1 ); - } - - default: /* impossible */ - return(-1); - } -} - -static int serbb_highpulsepin(PROGRAMMER * pgm, int pin) -{ - if (pin < 1 || pin > 7) - return -1; - - serbb_setpin(pgm, pin, 1); - #if SLOW_TOGGLE - usleep(1000); - #endif - serbb_setpin(pgm, pin, 0); - - #if SLOW_TOGGLE - usleep(1000); - #endif - - return 0; -} - - - -static void serbb_display(PROGRAMMER *pgm, char *p) -{ - /* MAYBE */ -} - -static void serbb_enable(PROGRAMMER *pgm) -{ - /* nothing */ -} - -static void serbb_disable(PROGRAMMER *pgm) -{ - /* nothing */ -} - -static void serbb_powerup(PROGRAMMER *pgm) -{ - /* nothing */ -} - -static void serbb_powerdown(PROGRAMMER *pgm) -{ - /* nothing */ -} - -static int serbb_open(PROGRAMMER *pgm, char *port) -{ - struct termios mode; - int flags; - - /* adapted from uisp code */ - - pgm->fd = open(port, O_RDWR | O_NOCTTY | O_NONBLOCK); - - if (pgm->fd < 0) - return(-1); - - tcgetattr(pgm->fd, &mode); - oldmode = mode; - - mode.c_iflag = IGNBRK | IGNPAR; - mode.c_oflag = 0; - mode.c_cflag = CLOCAL | CREAD | CS8 | B9600; - mode.c_cc [VMIN] = 1; - mode.c_cc [VTIME] = 0; - - tcsetattr(pgm->fd, TCSANOW, &mode); - - /* Clear O_NONBLOCK flag. */ - flags = fcntl(pgm->fd, F_GETFL, 0); - if (flags == -1) - { - fprintf(stderr, "%s: Can not get flags\n", progname); - return(-1); - } - flags &= ~O_NONBLOCK; - if (fcntl(pgm->fd, F_SETFL, flags) == -1) - { - fprintf(stderr, "%s: Can not clear nonblock flag\n", progname); - return(-1); - } - - return(0); -} - -static void serbb_close(PROGRAMMER *pgm) -{ - tcsetattr(pgm->fd, TCSANOW, &oldmode); - return; -} - -void serbb_initpgm(PROGRAMMER *pgm) -{ - strcpy(pgm->type, "SERBB"); - - pgm->rdy_led = bitbang_rdy_led; - pgm->err_led = bitbang_err_led; - pgm->pgm_led = bitbang_pgm_led; - pgm->vfy_led = bitbang_vfy_led; - pgm->initialize = bitbang_initialize; - pgm->display = serbb_display; - pgm->enable = serbb_enable; - pgm->disable = serbb_disable; - pgm->powerup = serbb_powerup; - pgm->powerdown = serbb_powerdown; - pgm->program_enable = bitbang_program_enable; - pgm->chip_erase = bitbang_chip_erase; - pgm->cmd = bitbang_cmd; - pgm->open = serbb_open; - pgm->close = serbb_close; - pgm->setpin = serbb_setpin; - pgm->getpin = serbb_getpin; - pgm->highpulsepin = serbb_highpulsepin; -} - -#endif /* WIN32NATIVE */ Index: spokepov.cpp =================================================================== RCS file: /cvsroot/spokepov/wxsoft/spokepov.cpp,v retrieving revision 1.6 diff -u -d -r1.6 spokepov.cpp --- spokepov.cpp 17 Jul 2007 22:15:05 -0000 1.6 +++ spokepov.cpp 30 Sep 2007 07:21:06 -0000 @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -14,6 +15,7 @@ #include #include #include +#include #include #include @@ -250,7 +252,7 @@ int i = 0; while ((file = readdir(dir)) != NULL) { wxString filename(file->d_name); - if (filename.StartsWith("cu.")) { + if (filename.StartsWith("cu.") || filename.StartsWith("ttyS")) { filename = "/dev/"+filename; portMenuS->Append(ID_PORT_SERIAL+i, filename, filename, wxITEM_RADIO); i++; Index: usb.h =================================================================== RCS file: /cvsroot/spokepov/wxsoft/usb.h,v retrieving revision 1.2 diff -u -d -r1.2 usb.h --- usb.h 17 Jul 2007 21:40:58 -0000 1.2 +++ usb.h 30 Sep 2007 07:21:06 -0000 @@ -2,7 +2,6 @@ #define __USB_H__ #include -#include /* * 'interface' is defined somewhere in the Windows header files. This macro @@ -67,7 +66,9 @@ /* ensure byte-packed structures */ +#if defined (WIN32NATIVE) #include +#endif /* All standard descriptors have these 2 fields in common */ @@ -290,8 +291,9 @@ #endif - +#if defined (WIN32NATIVE) #include +#endif #ifdef __cplusplus @@ -347,6 +349,7 @@ /* Windows specific functions */ +#if defined (WIN32NATIVE) #define LIBUSB_HAS_INSTALL_SERVICE_NP 1 int usb_install_service_np(void); void CALLBACK usb_install_service_np_rundll(HWND wnd, HINSTANCE instance, @@ -366,6 +369,7 @@ int usb_touch_inf_file_np(const char *inf_file); void CALLBACK usb_touch_inf_file_np_rundll(HWND wnd, HINSTANCE instance, LPSTR cmd_line, int cmd_show); +#endif // WIN32NATIVE #define LIBUSB_HAS_INSTALL_NEEDS_RESTART_NP 1 int usb_install_needs_restart_np(void); Index: wheelpanel.cpp =================================================================== RCS file: /cvsroot/spokepov/wxsoft/wheelpanel.cpp,v retrieving revision 1.1 diff -u -d -r1.1 wheelpanel.cpp --- wheelpanel.cpp 18 Feb 2007 06:11:30 -0000 1.1 +++ wheelpanel.cpp 30 Sep 2007 07:21:06 -0000 @@ -1,3 +1,4 @@ +#include #include #include #include @@ -11,7 +12,9 @@ #include #include #include +#include #include +#include #include "wheelpanel.h" #include "globals.h"