- coding style harmonization

- check onsistency between Size & vSpan
This commit is contained in:
marschap
2007-04-04 13:52:38 +00:00
parent 3e616e4192
commit 0f0af0f381
19 changed files with 437 additions and 439 deletions
+31 -38
View File
@@ -40,9 +40,9 @@
#endif
void lis2_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch);
void lis2_HD44780_backlight (PrivateData *p, unsigned char state);
unsigned char lis2_HD44780_scankeypad (PrivateData *p);
void lis2_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch);
void lis2_HD44780_backlight(PrivateData *p, unsigned char state);
unsigned char lis2_HD44780_scankeypad(PrivateData *p);
void SetMatrice(PrivateData *p,int fd, int matriceNum, int ligne, int point);
void SetFan(int fd, int fan1, int fan2, int fan3, int fan4);
void gotoXY(int fd, int x, int y);
@@ -55,7 +55,7 @@ void clear(int fd);
void writeChar(int fd, int code);
// initialise the driver
int hd_init_lis2 (Driver *drvthis)
int hd_init_lis2(Driver *drvthis)
{
PrivateData *p = (PrivateData*) drvthis->private_data;
@@ -100,7 +100,7 @@ int hd_init_lis2 (Driver *drvthis)
p->hd44780_functions->backlight = lis2_HD44780_backlight;
p->hd44780_functions->scankeypad = lis2_HD44780_scankeypad;
common_init (p, IF_8BIT);
common_init(p, IF_8BIT);
return 0;
}
@@ -154,32 +154,28 @@ int mode = 0;
int charNum = 0;
int rowNum = 0;
void lis2_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
void lis2_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
{
if (flags == RS_DATA) {
if (mode == SETCHAR)
{
writeChar( p->fd, 0);
writeChar( p->fd, 171);
writeChar( p->fd, charNum);
writeChar( p->fd, rowNum);
writeChar( p->fd, ch);
rowNum = rowNum + 1;
if (rowNum==p->cellheight)
{
if (mode == SETCHAR) {
writeChar(p->fd, 0);
writeChar(p->fd, 171);
writeChar(p->fd, charNum);
writeChar(p->fd, rowNum);
writeChar(p->fd, ch);
rowNum++;
if (rowNum == p->cellheight) {
mode = 0;
rowNum = 0;
}
}
else
{
if (ch<7) ch=ch+1;
write( p->fd, &ch, 1 );
else {
if (ch < 7) ch++;
write(p->fd, &ch, 1);
}
}
else {
if ((ch & POSITION)!=0)
{
if ((ch & POSITION) != 0) {
int x = 0;
int y = 0;
int pos = 0;
@@ -187,41 +183,38 @@ void lis2_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned ch
pos = (ch & ~POSITION);
if (p->ext_mode) {
y = pos/0x20;
x = pos-(y*0x20);
y = pos / 0x20;
x = pos - (y * 0x20);
}
else {
y = pos/0x40;
x = pos-(y*0x40);
y = pos / 0x40;
x = pos - (y * 0x40);
}
writeChar( p->fd, 0);
writeChar( p->fd, 161 + y);
writeChar( p->fd, x);
writeChar( p->fd, 167);
writeChar(p->fd, 0);
writeChar(p->fd, 161 + y);
writeChar(p->fd, x);
writeChar(p->fd, 167);
}
else if ((ch & SETCHAR)!=0)
{
else if ((ch & SETCHAR) != 0) {
mode = SETCHAR;
charNum = ((ch & ~SETCHAR)/8) + 1;
if (charNum==8) charNum = 7;
if (charNum == 8) charNum = 7;
}
else write( p->fd, &ch, 1 );
else write(p->fd, &ch, 1);
}
}
void lis2_HD44780_backlight (PrivateData *p, unsigned char state)
void lis2_HD44780_backlight(PrivateData *p, unsigned char state)
{
/* No backlight control */
}
unsigned char lis2_HD44780_scankeypad (PrivateData *p)
unsigned char lis2_HD44780_scankeypad(PrivateData *p)
{
return 0;
}