mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-28 06:55:27 +00:00
* ppi.c: Include system dependant parallel port interface file. (ppi_open): Add call to ppi_claim(). (ppi_close): Add call to ppi_release(). * ppi.h: Define ppi_claim() and ppi_release() as NOPs if not previously defined. * stk500.c: Include inttypes header to quell compiler warning. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@184 81a1dc3b-b13d-400b-aceb-764788c761c2
38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
#ifndef __linux_ppdev_h__
|
|
#define __linux_ppdev_h__
|
|
|
|
#define OBSOLETE__IOW _IOW
|
|
|
|
#include <sys/ioctl.h>
|
|
#include <linux/parport.h>
|
|
#include <linux/ppdev.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#define PPISDATA PPWDATA
|
|
#define PPIGDATA PPRDATA
|
|
|
|
#define PPISCTRL PPWCONTROL
|
|
#define PPIGCTRL PPRCONTROL
|
|
|
|
#define PPISSTATUS PPWSTATUS
|
|
#define PPIGSTATUS PPRSTATUS
|
|
|
|
#define ppi_claim(pgm) \
|
|
if (ioctl(pgm->fd, PPCLAIM)) { \
|
|
fprintf(stderr, "%s: can't claim device \"%s\": %s\n\n", \
|
|
progname, port, strerror(errno)); \
|
|
close(pgm->fd); \
|
|
exit(1); \
|
|
}
|
|
|
|
#define ppi_release(pgm) \
|
|
if (ioctl(pgm->fd, PPRELEASE)) { \
|
|
fprintf(stderr, "%s: can't release device: %s\n\n", \
|
|
progname, strerror(errno)); \
|
|
exit(1); \
|
|
}
|
|
|
|
|
|
#endif /* __linux_ppdev_h__ */
|