harmonize coding style and messages
This commit is contained in:
+32
-39
@@ -157,14 +157,14 @@ sed1520_init (Driver *drvthis)
|
|||||||
/* End of config file parsing */
|
/* End of config file parsing */
|
||||||
|
|
||||||
if (timing_init() == -1) {
|
if (timing_init() == -1) {
|
||||||
report(RPT_ERR, "timing_init: failed (%s)\n", strerror(errno));
|
report(RPT_ERR, "%s: timing_init() failed (%s)", drvthis->name, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate our framebuffer
|
// Allocate our framebuffer
|
||||||
framebuf = malloc(122 * 4);
|
framebuf = malloc(122 * 4);
|
||||||
if (!framebuf)
|
if (framebuf == NULL) {
|
||||||
{
|
report(RPT_ERR, "%s: unable to allocate framebuffer", drvthis->name);
|
||||||
// sed1520_close ();
|
// sed1520_close ();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -173,8 +173,10 @@ sed1520_init (Driver *drvthis)
|
|||||||
memset (framebuf, 0, 122 * 4);
|
memset (framebuf, 0, 122 * 4);
|
||||||
|
|
||||||
// Initialize the Port and the sed1520s
|
// Initialize the Port and the sed1520s
|
||||||
if(port_access(sed1520_lptport)) return -1;
|
if ((port_access(sed1520_lptport)) || (port_access(sed1520_lptport+2))) {
|
||||||
if(port_access(sed1520_lptport+2)) return -1;
|
report(RPT_ERR, "%s: unable to access port 0x%03X", drvthis->name, sed1520_lptport);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
port_out(sed1520_lptport,0);
|
port_out(sed1520_lptport,0);
|
||||||
port_out(sed1520_lptport +2,WR + CS2);
|
port_out(sed1520_lptport +2,WR + CS2);
|
||||||
@@ -186,6 +188,8 @@ sed1520_init (Driver *drvthis)
|
|||||||
cellwidth = 6;
|
cellwidth = 6;
|
||||||
cellheight = 8;
|
cellheight = 8;
|
||||||
|
|
||||||
|
report(RPT_DEBUG, "%s: init() done", drvthis->name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,12 +257,14 @@ MODULE_EXPORT void
|
|||||||
sed1520_flush (Driver *drvthis)
|
sed1520_flush (Driver *drvthis)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
for (i = 0; i < 4; i++)
|
|
||||||
{
|
for (i = 0; i < 4; i++) {
|
||||||
selectpage(i);
|
selectpage(i);
|
||||||
|
|
||||||
selectcolumn(0, CS2) ;
|
selectcolumn(0, CS2) ;
|
||||||
for (j = 0; j < 61; j++)
|
for (j = 0; j < 61; j++)
|
||||||
writedata(framebuf[j + (i * 122)], CS2);
|
writedata(framebuf[j + (i * 122)], CS2);
|
||||||
|
|
||||||
selectcolumn(0, CS1) ;
|
selectcolumn(0, CS1) ;
|
||||||
for (j = 61; j < 122; j++)
|
for (j = 61; j < 122; j++)
|
||||||
writedata(framebuf[j + (i * 122)], CS1);
|
writedata(framebuf[j + (i * 122)], CS1);
|
||||||
@@ -273,11 +279,11 @@ MODULE_EXPORT void
|
|||||||
sed1520_string (Driver *drvthis, int x, int y, char string[])
|
sed1520_string (Driver *drvthis, int x, int y, char string[])
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
x--; // Convert 1-based coords to 0-based...
|
x--; // Convert 1-based coords to 0-based...
|
||||||
y--;
|
y--;
|
||||||
|
|
||||||
for (i = 0; string[i]; i++)
|
for (i = 0; string[i] != '\0'; i++) {
|
||||||
{
|
|
||||||
drawchar2fb(x + i, y, string[i]);
|
drawchar2fb(x + i, y, string[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -314,15 +320,11 @@ sed1520_num (Driver *drvthis, int x, int num)
|
|||||||
if (num == 10 && (x < 0 || x > 19))
|
if (num == 10 && (x < 0 || x > 19))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (num == 10)
|
if (num == 10) { // Doppelpunkt
|
||||||
{ // Doppelpunkt
|
for (z = 0; z < 3; z++) { // Zeilen a 8 Punkte
|
||||||
for (z = 0; z < 3; z++)
|
for (c = 0; c < 6; c++) { // 6 Spalten
|
||||||
{ // Zeilen a 8 Punkte
|
|
||||||
for (c = 0; c < 6; c++)
|
|
||||||
{ // 6 Spalten
|
|
||||||
s = 0;
|
s = 0;
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++) { // 8 bits aus zeilen
|
||||||
{ // 8 bits aus zeilen
|
|
||||||
s >>= 1;
|
s >>= 1;
|
||||||
if (*(fontbigdp[(z * 8) + i] + c) == '.')
|
if (*(fontbigdp[(z * 8) + i] + c) == '.')
|
||||||
s += 128;
|
s += 128;
|
||||||
@@ -331,16 +333,11 @@ sed1520_num (Driver *drvthis, int x, int num)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
for (z = 0; z < 3; z++) { // Zeilen a 8 Punkte
|
||||||
|
for (c = 0; c < 18; c++) { // 18 Spalten
|
||||||
for (z = 0; z < 3; z++)
|
|
||||||
{ // Zeilen a 8 Punkte
|
|
||||||
for (c = 0; c < 18; c++)
|
|
||||||
{ // 18 Spalten
|
|
||||||
s = 0;
|
s = 0;
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++) { // 8 bits aus zeilen
|
||||||
{ // 8 bits aus zeilen
|
|
||||||
s >>= 1;
|
s >>= 1;
|
||||||
if (*(fontbignum[num][z * 8 + i] + c) == '.')
|
if (*(fontbignum[num][z * 8 + i] + c) == '.')
|
||||||
s += 128;
|
s += 128;
|
||||||
@@ -364,17 +361,16 @@ sed1520_num (Driver *drvthis, int x, int num)
|
|||||||
MODULE_EXPORT void
|
MODULE_EXPORT void
|
||||||
sed1520_set_char (Driver *drvthis, int n, char *dat)
|
sed1520_set_char (Driver *drvthis, int n, char *dat)
|
||||||
{
|
{
|
||||||
|
|
||||||
int row, col, i;
|
int row, col, i;
|
||||||
|
|
||||||
if (n < 0 || n > 255)
|
if (n < 0 || n > 255)
|
||||||
return;
|
return;
|
||||||
if (!dat)
|
if (!dat)
|
||||||
return;
|
return;
|
||||||
for (row = 0; row < 8; row++)
|
|
||||||
{
|
for (row = 0; row < 8; row++) {
|
||||||
i = 0;
|
i = 0;
|
||||||
for (col = 0; col < 6; col++)
|
for (col = 0; col < 6; col++) {
|
||||||
{
|
|
||||||
i <<= 1;
|
i <<= 1;
|
||||||
i |= (dat[(row * 6) + col] > 0);
|
i |= (dat[(row * 6) + col] > 0);
|
||||||
}
|
}
|
||||||
@@ -391,15 +387,13 @@ MODULE_EXPORT void
|
|||||||
sed1520_old_vbar (Driver *drvthis, int x, int len)
|
sed1520_old_vbar (Driver *drvthis, int x, int len)
|
||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
|
|
||||||
x--;
|
x--;
|
||||||
|
|
||||||
|
for (j = 0; j < 3; j++) {
|
||||||
for (j = 0; j < 3; j++)
|
|
||||||
{
|
|
||||||
i = 0;
|
i = 0;
|
||||||
k = 0;
|
k = 0;
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++) {
|
||||||
{
|
|
||||||
if (len > i)
|
if (len > i)
|
||||||
k += 1 << (7 - i);
|
k += 1 << (7 - i);
|
||||||
}
|
}
|
||||||
@@ -412,7 +406,6 @@ sed1520_old_vbar (Driver *drvthis, int x, int len)
|
|||||||
framebuf[((3 - j) * 122) + (x * 6) + 5] = 0;
|
framebuf[((3 - j) * 122) + (x * 6) + 5] = 0;
|
||||||
len -= 8;
|
len -= 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -424,6 +417,7 @@ MODULE_EXPORT void
|
|||||||
sed1520_old_hbar (Driver *drvthis, int x, int y, int len)
|
sed1520_old_hbar (Driver *drvthis, int x, int y, int len)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
x--;
|
x--;
|
||||||
y--;
|
y--;
|
||||||
|
|
||||||
@@ -461,8 +455,7 @@ sed1520_icon (Driver *drvthis, int x, int y, int icon)
|
|||||||
1, 1, 0, 1, 1,
|
1, 1, 0, 1, 1,
|
||||||
1, 1, 1, 1, 1 };
|
1, 1, 1, 1, 1 };
|
||||||
|
|
||||||
switch( icon )
|
switch (icon) {
|
||||||
{
|
|
||||||
case ICON_BLOCK_FILLED:
|
case ICON_BLOCK_FILLED:
|
||||||
sed1520_chr(drvthis, x, y, 255);
|
sed1520_chr(drvthis, x, y, 255);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user