[ 2782584 ] PPWDATA and PPWCONTROL ioclts take unsigned char not uint8_t (Yen Rui)

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1598 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent b4ec05ed41
commit e66ca022bd

@ -1,3 +1,9 @@
2009-05-16 Arnim Laeuger <arniml>
* include/urjtag/parport.h, src/tap/parport/ppdev.c, src/tap/parport/ppi.c,
src/tap/parport/direct.c, src/tap/parport.c: [ 2782584 ] PPWDATA and PPWCONTROL
ioclts take unsigned char not uint8_t (Yen Rui)
2009-05-14 Arnim Laeuger <arniml>
* src/svf/svf_bison.y, src/svf/svf.c, src/cmd/cmd_svf.c,

@ -40,13 +40,13 @@ typedef struct
/** @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error */
int (*close) (urj_parport_t *);
/** @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error */
int (*set_data) (urj_parport_t *, uint8_t);
int (*set_data) (urj_parport_t *, unsigned char);
/** @return data on success; -1 on error */
int (*get_data) (urj_parport_t *);
/** @return status on success; -1 on error */
int (*get_status) (urj_parport_t *);
/** @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error */
int (*set_control) (urj_parport_t *, uint8_t);
int (*set_control) (urj_parport_t *, unsigned char);
}
urj_parport_driver_t;
@ -59,12 +59,12 @@ struct urj_parport
int urj_tap_parport_open (urj_parport_t *port);
int urj_tap_parport_close (urj_parport_t *port);
int urj_tap_parport_set_data (urj_parport_t *port, uint8_t data);
int urj_tap_parport_set_data (urj_parport_t *port, const unsigned char data);
/** @return data on success; -1 on error */
int urj_tap_parport_get_data (urj_parport_t *port);
/** @return status on success; -1 on error */
int urj_tap_parport_get_status (urj_parport_t *port);
int urj_tap_parport_set_control (urj_parport_t *port, uint8_t data);
int urj_tap_parport_set_control (urj_parport_t *port, const unsigned char data);
extern urj_parport_driver_t *urj_tap_parport_drivers[];

@ -62,7 +62,7 @@ urj_tap_parport_close (urj_parport_t *port)
}
int
urj_tap_parport_set_data (urj_parport_t *port, uint8_t data)
urj_tap_parport_set_data (urj_parport_t *port, const unsigned char data)
{
return port->driver->set_data (port, data);
}
@ -80,7 +80,7 @@ urj_tap_parport_get_status (urj_parport_t *port)
}
int
urj_tap_parport_set_control (urj_parport_t *port, uint8_t data)
urj_tap_parport_set_control (urj_parport_t *port, const unsigned char data)
{
return port->driver->set_control (port, data);
}

@ -287,9 +287,9 @@ direct_close (urj_parport_t *parport)
}
static int
direct_set_data (urj_parport_t *parport, uint8_t data)
direct_set_data (urj_parport_t *parport, unsigned char data)
{
unsigned int port = ((direct_params_t *) parport->params)->port;
unsigned short int port = ((direct_params_t *) parport->params)->port;
outb (data, port);
return URJ_STATUS_OK;
}
@ -309,9 +309,9 @@ direct_get_status (urj_parport_t *parport)
}
static int
direct_set_control (urj_parport_t *parport, uint8_t data)
direct_set_control (urj_parport_t *parport, unsigned char data)
{
unsigned int port = ((direct_params_t *) parport->params)->port;
unsigned short int port = ((direct_params_t *) parport->params)->port;
outb (data ^ 0x0B, port + 2); /* SELECT, AUTOFD, and STROBE are inverted */
return URJ_STATUS_OK;
}

@ -197,7 +197,7 @@ ppdev_close (urj_parport_t *parport)
}
static int
ppdev_set_data (urj_parport_t *parport, uint8_t data)
ppdev_set_data (urj_parport_t *parport, unsigned char data)
{
ppdev_params_t *p = parport->params;
@ -241,7 +241,7 @@ ppdev_get_status (urj_parport_t *parport)
}
static int
ppdev_set_control (urj_parport_t *parport, uint8_t data)
ppdev_set_control (urj_parport_t *parport, unsigned char data)
{
ppdev_params_t *p = parport->params;

@ -180,11 +180,13 @@ ppi_close (urj_parport_t *parport)
}
static int
ppi_set_data (urj_parport_t *parport, uint8_t data)
ppi_set_data (urj_parport_t *parport, unsigned char data)
{
ppi_params_t *p = parport->params;
if (ioctl (p->fd, PPISDATA, &data) == -1)
uint8_t d = data;
if (ioctl (p->fd, PPISDATA, &d) == -1)
{
urj_error_IO_set ("ioctl(PPISDATA) fails");
return URJ_STATUS_FAIL;
@ -224,13 +226,13 @@ ppi_get_status (urj_parport_t *parport)
}
static int
ppi_set_control (urj_parport_t *parport, uint8_t data)
ppi_set_control (urj_parport_t *parport, unsigned char data)
{
ppi_params_t *p = parport->params;
data ^= 0x0B; /* SELECT, AUTOFD, and STROBE are inverted */
uint8_t d = data ^ 0x0B; /* SELECT, AUTOFD, and STROBE are inverted */
if (ioctl (p->fd, PPIGCTRL, &data) == -1)
if (ioctl (p->fd, PPIGCTRL, &d) == -1)
{
urj_error_IO_set ("ioctl(PPIGCTRL) fails");
return URJ_STATUS_FAIL;

Loading…
Cancel
Save