Removed lcddriver.c (doesn't do anything, isn't in any makefiles, etc.).

Passed *every* piece of source in this project through indent. I'm setting
things up with ctags soon and am actually going to *gasp* use a nice
programming environment to continue development in. :)
This commit is contained in:
William Ferrell
2000-03-30 20:20:41 +00:00
parent 2222adcfbe
commit f5a5e9653b
88 changed files with 8207 additions and 8723 deletions
+37 -44
View File
@@ -36,9 +36,7 @@
#include <string.h>
#include <errno.h>
void lcdwinamp_HD44780_senddata(unsigned char displayID,
unsigned char flags,
unsigned char ch);
void lcdwinamp_HD44780_senddata (unsigned char displayID, unsigned char flags, unsigned char ch);
#define EN1 STRB
#define EN2 SEL
@@ -46,64 +44,59 @@ void lcdwinamp_HD44780_senddata(unsigned char displayID,
#define RS INIT
static unsigned char EnMask[] = { EN1, EN2, EN3 };
static int EnMaskSize = sizeof(EnMask) / sizeof(unsigned char);
static int EnMaskSize = sizeof (EnMask) / sizeof (unsigned char);
static unsigned int lptPort;
static int extIF = 0; // non-zero if extended interface
// initialise the driver
int hd_init_winamp(HD44780_functions *hd44780_functions,
lcd_logical_driver *driver,
char *args,
unsigned int port)
int
hd_init_winamp (HD44780_functions * hd44780_functions, lcd_logical_driver * driver, char *args, unsigned int port)
{
// TODO: remove magic numbers below
char *argv[64];
int argc;
int i;
hd44780_functions->senddata = lcdwinamp_HD44780_senddata;
lptPort = port;
char *argv[64];
int argc;
int i;
// parse command-line arguments
argc = get_args(argv, args, 64);
hd44780_functions->senddata = lcdwinamp_HD44780_senddata;
lptPort = port;
for (i = 0; i < argc; ++i)
if (strcmp(argv[i], "-e") == 0 ||
strcmp(argv[i], "--extended") == 0)
extIF = 1;
// parse command-line arguments
argc = get_args (argv, args, 64);
if ((ioperm(lptPort + 2, 1, 255)) == -1) {
fprintf(stderr, "HD44780_init: failed (%s)\n", strerror(errno));
return -1;
}
for (i = 0; i < argc; ++i)
if (strcmp (argv[i], "-e") == 0 || strcmp (argv[i], "--extended") == 0)
extIF = 1;
common_init(IF_8bit);
return 0;
if ((ioperm (lptPort + 2, 1, 255)) == -1) {
fprintf (stderr, "HD44780_init: failed (%s)\n", strerror (errno));
return -1;
}
common_init (IF_8bit);
return 0;
}
// lcdwinamp_HD44780_senddata
void lcdwinamp_HD44780_senddata(unsigned char displayID,
unsigned char flags,
unsigned char ch)
void
lcdwinamp_HD44780_senddata (unsigned char displayID, unsigned char flags, unsigned char ch)
{
unsigned char dispID = 0, portControl;
unsigned char dispID = 0, portControl;
if (flags == RS_DATA)
portControl = RS;
else
portControl = 0;
if (flags == RS_DATA)
portControl = RS;
else
portControl = 0;
if (displayID == 0)
dispID = EnMask[0] | EnMask [1] | ((extIF) ? EnMask[2] : 0);
else
dispID = EnMask[displayID - 1];
port_out(lptPort, ch);
port_out(lptPort + 2, (dispID | portControl) ^ OUTMASK);
hd44780_functions->uPause(1);
port_out(lptPort + 2, portControl ^ OUTMASK);
if (displayID == 0)
dispID = EnMask[0] | EnMask[1] | ((extIF) ? EnMask[2] : 0);
else
dispID = EnMask[displayID - 1];
port_out (lptPort, ch);
port_out (lptPort + 2, (dispID | portControl) ^ OUTMASK);
hd44780_functions->uPause (1);
port_out (lptPort + 2, portControl ^ OUTMASK);
}