convert bignum library; adapt serialVFD, CFontzPacket, IOWarrior
This commit is contained in:
@@ -9,6 +9,8 @@ v.0.5dev (ongoing development)
|
|||||||
+ config file support in lcdproc client (thanks Andrew Foss)
|
+ config file support in lcdproc client (thanks Andrew Foss)
|
||||||
* install server & client config files in $(sysconfdir)
|
* install server & client config files in $(sysconfdir)
|
||||||
+ new client lcdvc: virtual console on LCD
|
+ new client lcdvc: virtual console on LCD
|
||||||
|
* convert adv_bignum library to bitwise set_char()
|
||||||
|
* adapt IOWarrior, CFontzPacket, seriaVFD to modified bignum library
|
||||||
|
|
||||||
v0.5.0
|
v0.5.0
|
||||||
This version has split off from unstable-0.4.3. Includes major changes.
|
This version has split off from unstable-0.4.3. Includes major changes.
|
||||||
|
|||||||
+1
-1
@@ -117,7 +117,7 @@ API_VERSION in the code.
|
|||||||
// - It is currently unclear how this system should work exactly
|
// - It is currently unclear how this system should work exactly
|
||||||
// - The set_char function expects a simple block of data with 1 byte for each pixel-line.
|
// - The set_char function expects a simple block of data with 1 byte for each pixel-line.
|
||||||
// (So that is 8 bytes for a 5x8 char)
|
// (So that is 8 bytes for a 5x8 char)
|
||||||
void (*set_char) (Driver *drvthis, char ch, char *dat);
|
void (*set_char) (Driver *drvthis, char ch, unsigned char *dat);
|
||||||
int (*get_free_chars) (Driver *drvthis);
|
int (*get_free_chars) (Driver *drvthis);
|
||||||
|
|
||||||
// get width & height of a character cell (in pixels)
|
// get width & height of a character cell (in pixels)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ API_VERSION in the code.
|
|||||||
// - It is currently unclear how this system should work exactly
|
// - It is currently unclear how this system should work exactly
|
||||||
// - The set_char function expects a simple block of data with 1 byte for each pixel-line.
|
// - The set_char function expects a simple block of data with 1 byte for each pixel-line.
|
||||||
// (So that is 8 bytes for a 5x8 char)
|
// (So that is 8 bytes for a 5x8 char)
|
||||||
void (*set_char) (Driver *drvthis, char ch, char *dat);
|
void (*set_char) (Driver *drvthis, char ch, unsigned char *dat);
|
||||||
int (*get_free_chars) (Driver *drvthis);
|
int (*get_free_chars) (Driver *drvthis);
|
||||||
|
|
||||||
// get width / height of a character cell (in pixels)
|
// get width / height of a character cell (in pixels)
|
||||||
@@ -473,10 +473,12 @@ typedef struct my_driver_private {
|
|||||||
<funcdef>void <function>(*set_char)</function></funcdef>
|
<funcdef>void <function>(*set_char)</function></funcdef>
|
||||||
<paramdef>Driver *<parameter>drvthis</parameter></paramdef>
|
<paramdef>Driver *<parameter>drvthis</parameter></paramdef>
|
||||||
<paramdef>char <parameter>ch</parameter></paramdef>
|
<paramdef>char <parameter>ch</parameter></paramdef>
|
||||||
<paramdef>char *<parameter>dat</parameter></paramdef>
|
<paramdef>unsigned char *<parameter>dat</parameter></paramdef>
|
||||||
</funcprototype>
|
</funcprototype>
|
||||||
</funcsynopsis>
|
</funcsynopsis>
|
||||||
<para>
|
<para>
|
||||||
|
The set_char function expects a simple block of data with 1 byte for each pixel-line.
|
||||||
|
(So that is 8 bytes for a 5x8 char)
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<funcsynopsis>
|
<funcsynopsis>
|
||||||
|
|||||||
+11
-202
@@ -75,30 +75,7 @@
|
|||||||
#include "report.h"
|
#include "report.h"
|
||||||
#include "lcd_lib.h"
|
#include "lcd_lib.h"
|
||||||
#include "CFontz-charmap.h"
|
#include "CFontz-charmap.h"
|
||||||
|
#include "adv_bignum.h"
|
||||||
#define b_______ 0x00
|
|
||||||
#define b_____X_ 0x03
|
|
||||||
#define b_____XX 0x03
|
|
||||||
#define b____X__ 0x04
|
|
||||||
#define b____XX_ 0x06
|
|
||||||
#define b____XXX 0x07
|
|
||||||
#define b___X___ 0x08
|
|
||||||
#define b___XX__ 0x09
|
|
||||||
#define b___X_X_ 0x0A
|
|
||||||
#define b___XXX_ 0x0E
|
|
||||||
#define b___XXXX 0x0F
|
|
||||||
#define b__X____ 0x10
|
|
||||||
#define b__X___X 0x11
|
|
||||||
#define b__X_X_X 0x15
|
|
||||||
#define b__X_XX_ 0x16
|
|
||||||
#define b__XX___ 0x18
|
|
||||||
#define b__XX_XX 0x1B
|
|
||||||
#define b__XXX__ 0x1C
|
|
||||||
#define b__XXX_X 0x1D
|
|
||||||
#define b__XXXX_ 0x1E
|
|
||||||
#define b__XXXXX 0x1F
|
|
||||||
#define b_XXX___ 0x38
|
|
||||||
#define b_XXXXXX 0x3F
|
|
||||||
|
|
||||||
|
|
||||||
#define CFP_KEY_UP 1
|
#define CFP_KEY_UP 1
|
||||||
@@ -943,200 +920,32 @@ CFontzPacket_hbar (Driver *drvthis, int x, int y, int len, int promille, int opt
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Inits big numbers
|
* Writes a big number.
|
||||||
*/
|
*/
|
||||||
static void
|
MODULE_EXPORT void
|
||||||
CFontzPacket_init_num(Driver *drvthis)
|
CFontzPacket_num(Driver *drvthis, int x, int num)
|
||||||
{
|
{
|
||||||
PrivateData *p = drvthis->private_data;
|
PrivateData *p = drvthis->private_data;
|
||||||
|
int do_init = 0;
|
||||||
|
|
||||||
unsigned char bignum_ccs[8][CELLHEIGHT] = {
|
if ((num < 0) || (num > 10))
|
||||||
[0]
|
return;
|
||||||
{ b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______ },
|
|
||||||
[1]
|
|
||||||
{ b____XXX,
|
|
||||||
b____XXX,
|
|
||||||
b____XXX,
|
|
||||||
b____XXX,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___ },
|
|
||||||
[2]
|
|
||||||
{ b_XXXXXX,
|
|
||||||
b_XXXXXX,
|
|
||||||
b_XXXXXX,
|
|
||||||
b_XXXXXX,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______ },
|
|
||||||
[3]
|
|
||||||
{ b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___ },
|
|
||||||
[4]
|
|
||||||
{ b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b____XXX,
|
|
||||||
b____XXX,
|
|
||||||
b____XXX,
|
|
||||||
b____XXX },
|
|
||||||
[5]
|
|
||||||
{ b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_XXXXXX,
|
|
||||||
b_XXXXXX,
|
|
||||||
b_XXXXXX,
|
|
||||||
b_XXXXXX },
|
|
||||||
[6]
|
|
||||||
{ b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___,
|
|
||||||
b_XXX___ },
|
|
||||||
[7]
|
|
||||||
{ b____XXX,
|
|
||||||
b____XXX,
|
|
||||||
b____XXX,
|
|
||||||
b____XXX,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______ }
|
|
||||||
};
|
|
||||||
|
|
||||||
if (p->ccmode != bignum) {
|
if (p->ccmode != bignum) {
|
||||||
int i;
|
|
||||||
|
|
||||||
if (p->ccmode != standard) {
|
if (p->ccmode != standard) {
|
||||||
/* Not supported (yet) */
|
/* Not supported (yet) */
|
||||||
report(RPT_WARNING, "%s: init_num: cannot combine two modes using user defined characters",
|
report(RPT_WARNING, "%s: num: cannot combine two modes using user defined characters",
|
||||||
drvthis->name);
|
drvthis->name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->ccmode = bignum;
|
p->ccmode = bignum;
|
||||||
|
|
||||||
for (i = 0; i < NUM_CCs; i++)
|
do_init = 1;
|
||||||
CFontzPacket_set_char(drvthis, i, bignum_ccs[i]);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
// Lib_adv_bignum does everything needed to show the bignumbers.
|
||||||
/*
|
lib_adv_bignum(drvthis, x, num, do_init, NUM_CCs);
|
||||||
* Writes a big number.
|
|
||||||
* Only works on 4-line displays
|
|
||||||
*/
|
|
||||||
MODULE_EXPORT void
|
|
||||||
CFontzPacket_num(Driver *drvthis, int x, int num)
|
|
||||||
{
|
|
||||||
PrivateData *p = drvthis->private_data;
|
|
||||||
|
|
||||||
/* each bignum is constructed in a 3 x 4 matrix and consists
|
|
||||||
* of only the 8 characters defined above as well as ' '
|
|
||||||
*
|
|
||||||
* The following table defines the 11 big numbers '0'-'9', ':'
|
|
||||||
* and the custom base characters they consist of
|
|
||||||
*/
|
|
||||||
char bignum_map[11][4][3] = {
|
|
||||||
{ /* 0: */
|
|
||||||
{ 1, 2, 3 },
|
|
||||||
{ 6, 32, 6 },
|
|
||||||
{ 6, 32, 6 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 1: */
|
|
||||||
{ 7, 6, 32 },
|
|
||||||
{ 32, 6, 32 },
|
|
||||||
{ 32, 6, 32 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 2: */
|
|
||||||
{ 1, 2, 3 },
|
|
||||||
{ 32, 5, 0 },
|
|
||||||
{ 1, 32, 32 },
|
|
||||||
{ 2, 2, 0 } },
|
|
||||||
{ /* 3: */
|
|
||||||
{ 1, 2, 3 },
|
|
||||||
{ 32, 5, 0 },
|
|
||||||
{ 3, 32, 6 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 4: */
|
|
||||||
{ 32, 3, 6 },
|
|
||||||
{ 1, 32, 6 },
|
|
||||||
{ 2, 2, 6 },
|
|
||||||
{ 32, 32, 0 } },
|
|
||||||
{ /* 5: */
|
|
||||||
{ 1, 2, 0 },
|
|
||||||
{ 2, 2, 3 },
|
|
||||||
{ 3, 32, 6 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 6: */
|
|
||||||
{ 1, 2, 32 },
|
|
||||||
{ 6, 5, 32 },
|
|
||||||
{ 6, 32, 6 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 7: */
|
|
||||||
{ 2, 2, 6 },
|
|
||||||
{ 32, 1, 32 },
|
|
||||||
{ 32, 6, 32 },
|
|
||||||
{ 32, 0, 32 } },
|
|
||||||
{ /* 8: */
|
|
||||||
{ 1, 2, 3 },
|
|
||||||
{ 4, 5, 0 },
|
|
||||||
{ 6, 32, 6 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 9: */
|
|
||||||
{ 1, 2, 3 },
|
|
||||||
{ 4, 3, 6 },
|
|
||||||
{ 32, 1, 32 },
|
|
||||||
{ 7, 32, 32 } },
|
|
||||||
{ /* colon: (only 1st column used) */
|
|
||||||
{ 32, 32, 32 },
|
|
||||||
{ 0, 32, 32 },
|
|
||||||
{ 0, 32, 32 },
|
|
||||||
{ 32, 32, 32 } }
|
|
||||||
};
|
|
||||||
|
|
||||||
if ((num < 0) || (num > 10))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (p->height >= 4) {
|
|
||||||
int y = (p->height - 2) / 2; /* center vertically */
|
|
||||||
int x2, y2;
|
|
||||||
|
|
||||||
CFontzPacket_init_num(drvthis);
|
|
||||||
|
|
||||||
for (x2 = 0; x2 < 3; x2++) {
|
|
||||||
for (y2 = 0; y2 < 4; y2++) {
|
|
||||||
CFontzPacket_chr(drvthis, x+x2, y+y2, bignum_map[num][y2][x2]);
|
|
||||||
}
|
|
||||||
if (num == 10)
|
|
||||||
x2 = 2; /* = break, for colon only */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
CFontzPacket_chr(drvthis, x, 1 + (p->height - 1) / 2,
|
|
||||||
(num == 10) ? ':' : (num + '0'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+16
-203
@@ -44,27 +44,7 @@
|
|||||||
#include "IOWarrior.h"
|
#include "IOWarrior.h"
|
||||||
#include "report.h"
|
#include "report.h"
|
||||||
#include "lcd_lib.h"
|
#include "lcd_lib.h"
|
||||||
|
#include "adv_bignum.h"
|
||||||
#define b_______ 0x00
|
|
||||||
#define b_____X_ 0x03
|
|
||||||
#define b_____XX 0x03
|
|
||||||
#define b____X__ 0x04
|
|
||||||
#define b____XX_ 0x06
|
|
||||||
#define b___X___ 0x08
|
|
||||||
#define b___XX__ 0x09
|
|
||||||
#define b___X_X_ 0x0A
|
|
||||||
#define b___XXX_ 0x0E
|
|
||||||
#define b___XXXX 0x0F
|
|
||||||
#define b__X____ 0x10
|
|
||||||
#define b__X___X 0x11
|
|
||||||
#define b__X_X_X 0x15
|
|
||||||
#define b__X_XX_ 0x16
|
|
||||||
#define b__XX___ 0x18
|
|
||||||
#define b__XX_XX 0x1B
|
|
||||||
#define b__XXX__ 0x1C
|
|
||||||
#define b__XXX_X 0x1D
|
|
||||||
#define b__XXXX_ 0x1E
|
|
||||||
#define b__XXXXX 0x1F
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -747,108 +727,6 @@ PrivateData *p = drvthis->private_data;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************
|
|
||||||
* API: Sets up for big numbers
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
IOWarrior_init_num(Driver *drvthis)
|
|
||||||
{
|
|
||||||
PrivateData *p = drvthis->private_data;
|
|
||||||
|
|
||||||
unsigned char bignum_ccs[8][CELLHEIGHT] = {
|
|
||||||
[0]
|
|
||||||
{ b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______ },
|
|
||||||
[1]
|
|
||||||
{ b_____XX,
|
|
||||||
b_____XX,
|
|
||||||
b_____XX,
|
|
||||||
b_____XX,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___ },
|
|
||||||
[2]
|
|
||||||
{ b__XX_XX,
|
|
||||||
b__XX_XX,
|
|
||||||
b__XX_XX,
|
|
||||||
b__XX_XX,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______ },
|
|
||||||
[3]
|
|
||||||
{ b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___ },
|
|
||||||
[4]
|
|
||||||
{ b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b_____XX,
|
|
||||||
b_____XX,
|
|
||||||
b_____XX,
|
|
||||||
b_____XX },
|
|
||||||
[5]
|
|
||||||
{ b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b__XX_XX,
|
|
||||||
b__XX_XX,
|
|
||||||
b__XX_XX,
|
|
||||||
b__XX_XX },
|
|
||||||
[6]
|
|
||||||
{ b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___,
|
|
||||||
b__XX___ },
|
|
||||||
[7]
|
|
||||||
{ b_____XX,
|
|
||||||
b_____XX,
|
|
||||||
b_____XX,
|
|
||||||
b_____XX,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______,
|
|
||||||
b_______ }
|
|
||||||
};
|
|
||||||
|
|
||||||
if (p->ccmode != bignum) {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (p->ccmode != standard) {
|
|
||||||
/* Not supported (yet) */
|
|
||||||
report(RPT_WARNING, "%s: init_num: cannot combine two modes using user defined characters",
|
|
||||||
drvthis->name);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
p->ccmode = bignum;
|
|
||||||
|
|
||||||
for (i = 0; i < NUM_CCs; i++) {
|
|
||||||
IOWarrior_set_char(drvthis, i, bignum_ccs[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* API: Writes a big number.
|
* API: Writes a big number.
|
||||||
*/
|
*/
|
||||||
@@ -856,91 +734,26 @@ MODULE_EXPORT void
|
|||||||
IOWarrior_num(Driver *drvthis, int x, int num)
|
IOWarrior_num(Driver *drvthis, int x, int num)
|
||||||
{
|
{
|
||||||
PrivateData *p = drvthis->private_data;
|
PrivateData *p = drvthis->private_data;
|
||||||
|
int do_init = 0;
|
||||||
|
|
||||||
/* each bignum is constructed in a 3 x 4 matrix and consists
|
if ((num < 0) || (num > 10))
|
||||||
* of only the 8 characters defined above as well as ' '
|
return;
|
||||||
*
|
|
||||||
* The following table defines the 11 big numbers '0'-'9', ':'
|
|
||||||
* and the custom base characters they consist of
|
|
||||||
*/
|
|
||||||
char bignum_map[11][4][3] = {
|
|
||||||
{ /* 0: */
|
|
||||||
{ 1, 2, 3 },
|
|
||||||
{ 6, 32, 6 },
|
|
||||||
{ 6, 32, 6 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 1: */
|
|
||||||
{ 7, 6, 32 },
|
|
||||||
{ 32, 6, 32 },
|
|
||||||
{ 32, 6, 32 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 2: */
|
|
||||||
{ 1, 2, 3 },
|
|
||||||
{ 32, 5, 0 },
|
|
||||||
{ 1, 32, 32 },
|
|
||||||
{ 2, 2, 0 } },
|
|
||||||
{ /* 3: */
|
|
||||||
{ 1, 2, 3 },
|
|
||||||
{ 32, 5, 0 },
|
|
||||||
{ 3, 32, 6 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 4: */
|
|
||||||
{ 32, 3, 6 },
|
|
||||||
{ 1, 32, 6 },
|
|
||||||
{ 2, 2, 6 },
|
|
||||||
{ 32, 32, 0 } },
|
|
||||||
{ /* 5: */
|
|
||||||
{ 1, 2, 0 },
|
|
||||||
{ 2, 2, 3 },
|
|
||||||
{ 3, 32, 6 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 6: */
|
|
||||||
{ 1, 2, 32 },
|
|
||||||
{ 6, 5, 32 },
|
|
||||||
{ 6, 32, 6 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 7: */
|
|
||||||
{ 2, 2, 6 },
|
|
||||||
{ 32, 1, 32 },
|
|
||||||
{ 32, 6, 32 },
|
|
||||||
{ 32, 0, 32 } },
|
|
||||||
{ /* 8: */
|
|
||||||
{ 1, 2, 3 },
|
|
||||||
{ 4, 5, 0 },
|
|
||||||
{ 6, 32, 6 },
|
|
||||||
{ 7, 2, 32 } },
|
|
||||||
{ /* 9: */
|
|
||||||
{ 1, 2, 3 },
|
|
||||||
{ 4, 3, 6 },
|
|
||||||
{ 32, 1, 32 },
|
|
||||||
{ 7, 32, 32 } },
|
|
||||||
{ /* colon: (only 1st column used) */
|
|
||||||
{ 32, 32, 32 },
|
|
||||||
{ 0, 32, 32 },
|
|
||||||
{ 0, 32, 32 },
|
|
||||||
{ 32, 32, 32 } }
|
|
||||||
};
|
|
||||||
|
|
||||||
if ((num < 0) || (num > 10))
|
if (p->ccmode != bignum) {
|
||||||
return;
|
if (p->ccmode != standard) {
|
||||||
|
/* Not supported (yet) */
|
||||||
|
report(RPT_WARNING, "%s: num: cannot combine two modes using user defined characters",
|
||||||
|
drvthis->name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
IOWarrior_init_num(drvthis);
|
p->ccmode = bignum;
|
||||||
|
|
||||||
if (p->height >= 4) {
|
do_init = 1;
|
||||||
int y = (p->height - 2) / 2; /* center vertically */
|
}
|
||||||
int x2, y2;
|
|
||||||
|
|
||||||
for (x2 = 0; x2 < 3; x2++) {
|
// Lib_adv_bignum does everything needed to show the bignumbers.
|
||||||
for (y2 = 0; y2 < 4; y2++) {
|
lib_adv_bignum(drvthis, x, num, do_init, NUM_CCs);
|
||||||
IOWarrior_chr(drvthis, x+x2, y+y2, bignum_map[num][y2][x2]);
|
|
||||||
}
|
|
||||||
if (num == 10)
|
|
||||||
x2 = 2; /* = break, for colon only */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
IOWarrior_chr(drvthis, x, 1 + (p->height - 1)/ 2,
|
|
||||||
(num == 10) ? ':' : (num + '0'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ hd44780_CFLAGS = @libusb_cflags@ $(AM_CFLAGS)
|
|||||||
|
|
||||||
CFontz_LDADD = libLCD.a
|
CFontz_LDADD = libLCD.a
|
||||||
CFontz633_LDADD = libLCD.a
|
CFontz633_LDADD = libLCD.a
|
||||||
CFontzPacket_LDADD = libLCD.a
|
CFontzPacket_LDADD = libLCD.a libbignum.a
|
||||||
curses_LDADD = @LIBCURSES@
|
curses_LDADD = @LIBCURSES@
|
||||||
CwLnx_LDADD = libLCD.a
|
CwLnx_LDADD = libLCD.a
|
||||||
glcdlib_LDADD = libLCD.a @LIBGLCD@
|
glcdlib_LDADD = libLCD.a @LIBGLCD@
|
||||||
@@ -35,7 +35,7 @@ hd44780_LDADD = libLCD.a @HD44780_DRIVERS@ @libusb_libs@
|
|||||||
hd44780_DEPENDENCIES = @HD44780_DRIVERS@
|
hd44780_DEPENDENCIES = @HD44780_DRIVERS@
|
||||||
icp_a106_LDADD = libLCD.a
|
icp_a106_LDADD = libLCD.a
|
||||||
imon_LDADD = libLCD.a
|
imon_LDADD = libLCD.a
|
||||||
IOWarrior_LDADD = @libusb_libs@ libLCD.a
|
IOWarrior_LDADD = @libusb_libs@ libLCD.a libbignum.a
|
||||||
irman_LDADD = @LIBIRMAN@
|
irman_LDADD = @LIBIRMAN@
|
||||||
lirc_LDADD = @LIBLIRC_CLIENT@
|
lirc_LDADD = @LIBLIRC_CLIENT@
|
||||||
lcterm_LDADD = libLCD.a
|
lcterm_LDADD = libLCD.a
|
||||||
@@ -47,7 +47,7 @@ svga_LDADD = @LIBSVGA@
|
|||||||
t6963_LDADD = libLCD.a
|
t6963_LDADD = libLCD.a
|
||||||
tyan_LDADD = libLCD.a
|
tyan_LDADD = libLCD.a
|
||||||
ula200_LDADD = libLCD.a @LIBFTDI@
|
ula200_LDADD = libLCD.a @LIBFTDI@
|
||||||
sli_LDADD = libLCD.a
|
sli_LDADD = libLCD.a
|
||||||
xosd_LDADD = @LIBXOSD@
|
xosd_LDADD = @LIBXOSD@
|
||||||
|
|
||||||
libLCD_a_SOURCES = lcd_lib.h lcd_lib.c
|
libLCD_a_SOURCES = lcd_lib.h lcd_lib.c
|
||||||
@@ -56,7 +56,7 @@ libbignum_a_SOURCES = adv_bignum.h adv_bignum.c
|
|||||||
bayrad_SOURCES = lcd.h lcd_lib.h bayrad.h bayrad.c report.h
|
bayrad_SOURCES = lcd.h lcd_lib.h bayrad.h bayrad.c report.h
|
||||||
CFontz_SOURCES = lcd.h lcd_lib.h CFontz.c CFontz.h CFontz-charmap.h report.h
|
CFontz_SOURCES = lcd.h lcd_lib.h CFontz.c CFontz.h CFontz-charmap.h report.h
|
||||||
CFontz633_SOURCES = lcd.h lcd_lib.h CFontz633.c CFontz633.h CFontz-charmap.h CFontz633io.c CFontz633io.h report.h
|
CFontz633_SOURCES = lcd.h lcd_lib.h CFontz633.c CFontz633.h CFontz-charmap.h CFontz633io.c CFontz633io.h report.h
|
||||||
CFontzPacket_SOURCES = lcd.h lcd_lib.h CFontzPacket.c CFontzPacket.h CFontz-charmap.h CFontz633io.c CFontz633io.h report.h
|
CFontzPacket_SOURCES = lcd.h lcd_lib.h CFontzPacket.c CFontzPacket.h CFontz-charmap.h CFontz633io.c CFontz633io.h report.h adv_bignum.h
|
||||||
curses_SOURCES = lcd.h curses_drv.h curses_drv.c report.h
|
curses_SOURCES = lcd.h curses_drv.h curses_drv.c report.h
|
||||||
CwLnx_SOURCES = lcd.h lcd_lib.h CwLnx.c CwLnx.h report.h
|
CwLnx_SOURCES = lcd.h lcd_lib.h CwLnx.c CwLnx.h report.h
|
||||||
glcdlib_SOURCES = lcd.h lcd_lib.h glcdlib.h glcdlib.c report.h
|
glcdlib_SOURCES = lcd.h lcd_lib.h glcdlib.h glcdlib.c report.h
|
||||||
@@ -66,7 +66,7 @@ EXTRA_hd44780_SOURCES = hd44780-4bit.c hd44780-4bit.h hd44780-ext8bit.c hd44780-
|
|||||||
|
|
||||||
icp_a106_SOURCES = lcd.h lcd_lib.h icp_a106.c icp_a106.h report.h
|
icp_a106_SOURCES = lcd.h lcd_lib.h icp_a106.c icp_a106.h report.h
|
||||||
imon_SOURCES = lcd.h lcd_lib.h imon.h imon.c report.h
|
imon_SOURCES = lcd.h lcd_lib.h imon.h imon.c report.h
|
||||||
IOWarrior_SOURCES = lcd.h lcd_lib.h hd44780-charmap.h IOWarrior.c IOWarrior.h report.h
|
IOWarrior_SOURCES = lcd.h lcd_lib.h hd44780-charmap.h IOWarrior.c IOWarrior.h report.h adv_bignum.h
|
||||||
irman_SOURCES = lcd.h irmanin.c irmanin.h report.h
|
irman_SOURCES = lcd.h irmanin.c irmanin.h report.h
|
||||||
joy_SOURCES = lcd.h joy.c joy.h port.h report.h
|
joy_SOURCES = lcd.h joy.c joy.h port.h report.h
|
||||||
lb216_SOURCES = lcd.h lb216.c lb216.h report.h
|
lb216_SOURCES = lcd.h lb216.c lb216.h report.h
|
||||||
|
|||||||
+608
-486
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,34 @@
|
|||||||
|
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
|
|
||||||
void lib_adv_bignum (Driver *drvthis, int x, int num, int height , int do_init, int customchars);
|
#define b_______ 0x00
|
||||||
|
#define b______X 0x01
|
||||||
|
#define b_____X_ 0x03
|
||||||
|
#define b_____XX 0x03
|
||||||
|
#define b____X__ 0x04
|
||||||
|
#define b____XX_ 0x06
|
||||||
|
#define b____XXX 0x07
|
||||||
|
#define b___X___ 0x08
|
||||||
|
#define b___XX__ 0x09
|
||||||
|
#define b___X_X_ 0x0A
|
||||||
|
#define b___XXX_ 0x0E
|
||||||
|
#define b___XXXX 0x0F
|
||||||
|
#define b__X____ 0x10
|
||||||
|
#define b__X___X 0x11
|
||||||
|
#define b__X_X_X 0x15
|
||||||
|
#define b__X_XX_ 0x16
|
||||||
|
#define b__XX___ 0x18
|
||||||
|
#define b__XX__X 0x19
|
||||||
|
#define b__XX_XX 0x1B
|
||||||
|
#define b__XXX__ 0x1C
|
||||||
|
#define b__XXX_X 0x1D
|
||||||
|
#define b__XXXX_ 0x1E
|
||||||
|
#define b__XXXXX 0x1F
|
||||||
|
#define b_XXX___ 0x38
|
||||||
|
#define b_XXXXXX 0x3F
|
||||||
|
|
||||||
|
|
||||||
|
void lib_adv_bignum (Driver *drvthis, int x, int num, int do_init, int customchars);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ typedef struct lcd_logical_driver {
|
|||||||
void (*cursor) (struct lcd_logical_driver* drvthis, int x, int y, int type);
|
void (*cursor) (struct lcd_logical_driver* drvthis, int x, int y, int type);
|
||||||
|
|
||||||
/* user-defined character functions, are those still supported ? */
|
/* user-defined character functions, are those still supported ? */
|
||||||
void (*set_char) (struct lcd_logical_driver* drvthis, int n, char *dat);
|
void (*set_char) (struct lcd_logical_driver* drvthis, int n, unsigned char *dat);
|
||||||
int (*get_free_chars) (struct lcd_logical_driver* drvthis);
|
int (*get_free_chars) (struct lcd_logical_driver* drvthis);
|
||||||
int (*cellwidth) (struct lcd_logical_driver* drvthis);
|
int (*cellwidth) (struct lcd_logical_driver* drvthis);
|
||||||
int (*cellheight) (struct lcd_logical_driver* drvthis);
|
int (*cellheight) (struct lcd_logical_driver* drvthis);
|
||||||
|
|||||||
+63
-135
@@ -426,13 +426,14 @@ serialVFD_init (Driver *drvthis)
|
|||||||
p->charmap[tmp] = charmap_0[tmp];
|
p->charmap[tmp] = charmap_0[tmp];
|
||||||
|
|
||||||
//{bytes to send, icon bit mapped to bit 0, icon bit mapped to bit 1, ...}
|
//{bytes to send, icon bit mapped to bit 0, icon bit mapped to bit 1, ...}
|
||||||
const int usr_chr_dot_assignment_0[57]={7, 1, 2, 3, 4, 5, 0, 0, 0,
|
const int usr_chr_dot_assignment_0[57]={ 7,
|
||||||
6, 7, 8, 9,10, 0, 0, 0,
|
1, 2, 3, 4, 5, 0, 0, 0,
|
||||||
|
6, 7, 8, 9,10, 0, 0, 0,
|
||||||
11,12,13,14,15, 0, 0, 0,
|
11,12,13,14,15, 0, 0, 0,
|
||||||
16,17,18,19,20, 0, 0, 0,
|
16,17,18,19,20, 0, 0, 0,
|
||||||
21,22,23,24,25, 0, 0, 0,
|
21,22,23,24,25, 0, 0, 0,
|
||||||
26,27,28,29,30, 0, 0, 0,
|
26,27,28,29,30, 0, 0, 0,
|
||||||
31,32,33,34,35, 0, 0, 0};
|
31,32,33,34,35, 0, 0, 0 };
|
||||||
for (tmp = 0; tmp < 57 ;tmp++)
|
for (tmp = 0; tmp < 57 ;tmp++)
|
||||||
p->usr_chr_dot_assignment[tmp] = usr_chr_dot_assignment_0[tmp];
|
p->usr_chr_dot_assignment[tmp] = usr_chr_dot_assignment_0[tmp];
|
||||||
|
|
||||||
@@ -497,8 +498,9 @@ serialVFD_init (Driver *drvthis)
|
|||||||
|
|
||||||
|
|
||||||
//{bytes to send, icon bit mapped to bit 0, icon bit mapped to bit 1, ...}
|
//{bytes to send, icon bit mapped to bit 0, icon bit mapped to bit 1, ...}
|
||||||
const int usr_chr_dot_assignment_1[57]={7, 1, 2, 3, 4, 5, 0, 0, 0,
|
const int usr_chr_dot_assignment_1[57]={ 7,
|
||||||
6, 7, 8, 9,10, 0, 0, 0,
|
1, 2, 3, 4, 5, 0, 0, 0,
|
||||||
|
6, 7, 8, 9,10, 0, 0, 0,
|
||||||
11,12,13,14,15, 0, 0, 0,
|
11,12,13,14,15, 0, 0, 0,
|
||||||
16,17,18,19,20, 0, 0, 0,
|
16,17,18,19,20, 0, 0, 0,
|
||||||
21,22,23,24,25, 0, 0, 0,
|
21,22,23,24,25, 0, 0, 0,
|
||||||
@@ -546,12 +548,13 @@ serialVFD_init (Driver *drvthis)
|
|||||||
p->charmap[tmp]=tmp;
|
p->charmap[tmp]=tmp;
|
||||||
|
|
||||||
//{bytes to send, icon bit mapped to bit 0, icon bit mapped to bit 1, ...}
|
//{bytes to send, icon bit mapped to bit 0, icon bit mapped to bit 1, ...}
|
||||||
const int usr_chr_dot_assignment_2[57]={5, 1, 2, 3, 4, 5, 6, 7, 8,
|
const int usr_chr_dot_assignment_2[57]={ 5,
|
||||||
|
1, 2, 3, 4, 5, 6, 7, 8,
|
||||||
9,10,11,12,13,14,15,16,
|
9,10,11,12,13,14,15,16,
|
||||||
17,18,19,20,21,22,23,24,
|
17,18,19,20,21,22,23,24,
|
||||||
25,26,27,28,29,30,31,32,
|
25,26,27,28,29,30,31,32,
|
||||||
33,34,35, 0, 0, 0, 0, 0};
|
33,34,35, 0, 0, 0, 0, 0};
|
||||||
for (tmp=0;tmp < 57 ;tmp++)
|
for (tmp=0; tmp < 57; tmp++)
|
||||||
p->usr_chr_dot_assignment[tmp]=usr_chr_dot_assignment_2[tmp];
|
p->usr_chr_dot_assignment[tmp]=usr_chr_dot_assignment_2[tmp];
|
||||||
|
|
||||||
//Where to place the usercharacters (0..30) in the asciicode.
|
//Where to place the usercharacters (0..30) in the asciicode.
|
||||||
@@ -615,11 +618,12 @@ serialVFD_init (Driver *drvthis)
|
|||||||
p->charmap[tmp] = charmap_3[tmp];
|
p->charmap[tmp] = charmap_3[tmp];
|
||||||
|
|
||||||
//{bytes to send, icon bit mapped to bit 0, icon bit mapped to bit 1, ...}
|
//{bytes to send, icon bit mapped to bit 0, icon bit mapped to bit 1, ...}
|
||||||
const int usr_chr_dot_assignment_3[57]={5, 8, 7, 6, 5, 4, 3, 2, 1,
|
const int usr_chr_dot_assignment_3[57]={ 5,
|
||||||
|
8, 7, 6, 5, 4, 3, 2, 1,
|
||||||
16,15,14,13,12,11,10, 9,
|
16,15,14,13,12,11,10, 9,
|
||||||
24,23,22,21,20,19,18,17,
|
24,23,22,21,20,19,18,17,
|
||||||
32,31,30,29,28,27,26,25,
|
32,31,30,29,28,27,26,25,
|
||||||
0, 0, 0, 0, 0,35,34,33};
|
0, 0, 0, 0, 0,35,34,33};
|
||||||
for (tmp=0;tmp < 57 ;tmp++)
|
for (tmp=0;tmp < 57 ;tmp++)
|
||||||
p->usr_chr_dot_assignment[tmp]=usr_chr_dot_assignment_3[tmp];
|
p->usr_chr_dot_assignment[tmp]=usr_chr_dot_assignment_3[tmp];
|
||||||
|
|
||||||
@@ -710,7 +714,7 @@ serialVFD_hbar (Driver *drvthis, int x, int y, int len, int promille, int option
|
|||||||
// The input is just an array of characters...
|
// The input is just an array of characters...
|
||||||
//
|
//
|
||||||
MODULE_EXPORT void
|
MODULE_EXPORT void
|
||||||
serialVFD_set_char (Driver *drvthis, int n, char *dat)
|
serialVFD_set_char (Driver *drvthis, int n, unsigned char *dat)
|
||||||
{ //set char in p->custom_char
|
{ //set char in p->custom_char
|
||||||
PrivateData *p = drvthis->private_data;
|
PrivateData *p = drvthis->private_data;
|
||||||
unsigned int byte, bit;
|
unsigned int byte, bit;
|
||||||
@@ -724,8 +728,14 @@ serialVFD_set_char (Driver *drvthis, int n, char *dat)
|
|||||||
int letter = 0;
|
int letter = 0;
|
||||||
|
|
||||||
for (bit = 0; bit < 8; bit++) {
|
for (bit = 0; bit < 8; bit++) {
|
||||||
if ((int) p->usr_chr_dot_assignment[bit+8*byte+1] != 0)
|
int pos = (int) p->usr_chr_dot_assignment[bit+8*byte+1];
|
||||||
letter |= (dat[(int)p->usr_chr_dot_assignment[bit+8*byte+1]-1] << bit);
|
|
||||||
|
if (pos > 0) {
|
||||||
|
int posbyte = (pos-1) / 5;
|
||||||
|
int posbit = 4 - ((pos-1) % 5);
|
||||||
|
|
||||||
|
letter |= ((dat[posbyte] >> posbit) & 1) << bit;;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
p->custom_char[n][byte] = letter;
|
p->custom_char[n][byte] = letter;
|
||||||
}
|
}
|
||||||
@@ -848,7 +858,7 @@ serialVFD_num( Driver * drvthis, int x, int num )
|
|||||||
p->ccmode = CCMODE_BIGNUM; // Switch customcharactermode to bignum.
|
p->ccmode = CCMODE_BIGNUM; // Switch customcharactermode to bignum.
|
||||||
}
|
}
|
||||||
// Lib_adv_bignum does everything needed to show the bignumbers.
|
// Lib_adv_bignum does everything needed to show the bignumbers.
|
||||||
lib_adv_bignum(drvthis, x, num, p->height, do_init, p->customchars);
|
lib_adv_bignum(drvthis, x, num, do_init, p->customchars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -860,27 +870,25 @@ MODULE_EXPORT int
|
|||||||
serialVFD_icon (Driver *drvthis, int x, int y, int icon)
|
serialVFD_icon (Driver *drvthis, int x, int y, int icon)
|
||||||
{
|
{
|
||||||
PrivateData *p = drvthis->private_data;
|
PrivateData *p = drvthis->private_data;
|
||||||
char icons[2][5 * 7] = {
|
static unsigned char heart_open[] =
|
||||||
{
|
{ b__XXXXX,
|
||||||
1, 1, 1, 1, 1, // Empty Heart
|
b__X_X_X,
|
||||||
1, 0, 1, 0, 1,
|
b_______,
|
||||||
0, 0, 0, 0, 0,
|
b_______,
|
||||||
0, 0, 0, 0, 0,
|
b_______,
|
||||||
0, 0, 0, 0, 0,
|
b__X___X,
|
||||||
1, 0, 0, 0, 1,
|
b__XX_XX,
|
||||||
1, 1, 0, 1, 1,
|
b__XXXXX };
|
||||||
},
|
static unsigned char heart_filled[] =
|
||||||
|
{ b__XXXXX,
|
||||||
|
b__X_X_X,
|
||||||
|
b___X_X_,
|
||||||
|
b___XXX_,
|
||||||
|
b___XXX_,
|
||||||
|
b__X_X_X,
|
||||||
|
b__XX_XX,
|
||||||
|
b__XXXXX };
|
||||||
|
|
||||||
{
|
|
||||||
1, 1, 1, 1, 1, // Filled Heart
|
|
||||||
1, 0, 1, 0, 1,
|
|
||||||
0, 1, 0, 1, 0,
|
|
||||||
0, 1, 1, 1, 0,
|
|
||||||
0, 1, 1, 1, 0,
|
|
||||||
1, 0, 1, 0, 1,
|
|
||||||
1, 1, 0, 1, 1,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
// Yes we know, this is a VERY BAD implementation :-)
|
// Yes we know, this is a VERY BAD implementation :-)
|
||||||
switch (icon) {
|
switch (icon) {
|
||||||
case ICON_BLOCK_FILLED:
|
case ICON_BLOCK_FILLED:
|
||||||
@@ -888,12 +896,12 @@ serialVFD_icon (Driver *drvthis, int x, int y, int icon)
|
|||||||
break;
|
break;
|
||||||
case ICON_HEART_FILLED:
|
case ICON_HEART_FILLED:
|
||||||
p->ccmode = CCMODE_STANDARD;
|
p->ccmode = CCMODE_STANDARD;
|
||||||
serialVFD_set_char(drvthis, 0, icons[1]);
|
serialVFD_set_char(drvthis, 0, heart_filled);
|
||||||
serialVFD_chr(drvthis, x, y, 0);
|
serialVFD_chr(drvthis, x, y, 0);
|
||||||
break;
|
break;
|
||||||
case ICON_HEART_OPEN:
|
case ICON_HEART_OPEN:
|
||||||
p->ccmode = CCMODE_STANDARD;
|
p->ccmode = CCMODE_STANDARD;
|
||||||
serialVFD_set_char(drvthis, 0, icons[0]);
|
serialVFD_set_char(drvthis, 0, heart_open);
|
||||||
serialVFD_chr(drvthis, x, y, 0);
|
serialVFD_chr(drvthis, x, y, 0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -911,69 +919,20 @@ static void
|
|||||||
serialVFD_init_vbar (Driver *drvthis)
|
serialVFD_init_vbar (Driver *drvthis)
|
||||||
{
|
{
|
||||||
PrivateData *p = drvthis->private_data;
|
PrivateData *p = drvthis->private_data;
|
||||||
char a[] = {
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
};
|
|
||||||
char b[] = {
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
};
|
|
||||||
char c[] = {
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
};
|
|
||||||
char d[] = {
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
};
|
|
||||||
char e[] = {
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
};
|
|
||||||
char f[] = {
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (p->ccmode != CCMODE_VBAR) {
|
if (p->ccmode != CCMODE_VBAR) {
|
||||||
|
unsigned char vBar[p->cellheight];
|
||||||
|
int i;
|
||||||
|
|
||||||
p->ccmode = CCMODE_VBAR;
|
p->ccmode = CCMODE_VBAR;
|
||||||
serialVFD_set_char(drvthis, 1, a);
|
|
||||||
serialVFD_set_char(drvthis, 2, b);
|
memset(vBar, 0x00, sizeof(vBar));
|
||||||
serialVFD_set_char(drvthis, 3, c);
|
|
||||||
serialVFD_set_char(drvthis, 4, d);
|
for (i = 1; i < p->cellheight; i++) {
|
||||||
serialVFD_set_char(drvthis, 5, e);
|
// add pixel line per pixel line ...
|
||||||
serialVFD_set_char(drvthis, 6, f);
|
vBar[p->cellheight - i] = 0xFF;
|
||||||
|
serialVFD_set_char(drvthis, i, vBar);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -984,49 +943,18 @@ static void
|
|||||||
serialVFD_init_hbar (Driver *drvthis)
|
serialVFD_init_hbar (Driver *drvthis)
|
||||||
{
|
{
|
||||||
PrivateData *p = drvthis->private_data;
|
PrivateData *p = drvthis->private_data;
|
||||||
char a[] = {
|
|
||||||
1, 0, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 0,
|
|
||||||
};
|
|
||||||
char b[] = {
|
|
||||||
1, 1, 0, 0, 0,
|
|
||||||
1, 1, 0, 0, 0,
|
|
||||||
1, 1, 0, 0, 0,
|
|
||||||
1, 1, 0, 0, 0,
|
|
||||||
1, 1, 0, 0, 0,
|
|
||||||
1, 1, 0, 0, 0,
|
|
||||||
1, 1, 0, 0, 0,
|
|
||||||
};
|
|
||||||
char c[] = {
|
|
||||||
1, 1, 1, 0, 0,
|
|
||||||
1, 1, 1, 0, 0,
|
|
||||||
1, 1, 1, 0, 0,
|
|
||||||
1, 1, 1, 0, 0,
|
|
||||||
1, 1, 1, 0, 0,
|
|
||||||
1, 1, 1, 0, 0,
|
|
||||||
1, 1, 1, 0, 0,
|
|
||||||
};
|
|
||||||
char d[] = {
|
|
||||||
1, 1, 1, 1, 0,
|
|
||||||
1, 1, 1, 1, 0,
|
|
||||||
1, 1, 1, 1, 0,
|
|
||||||
1, 1, 1, 1, 0,
|
|
||||||
1, 1, 1, 1, 0,
|
|
||||||
1, 1, 1, 1, 0,
|
|
||||||
1, 1, 1, 1, 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (p->ccmode != CCMODE_HBAR) {
|
if (p->ccmode != CCMODE_HBAR) {
|
||||||
|
unsigned char hBar[p->cellheight];
|
||||||
|
int i;
|
||||||
|
|
||||||
p->ccmode = CCMODE_HBAR;
|
p->ccmode = CCMODE_HBAR;
|
||||||
serialVFD_set_char(drvthis, 1, a);
|
|
||||||
serialVFD_set_char(drvthis, 2, b);
|
for (i = 1; i < p->cellwidth; i++) {
|
||||||
serialVFD_set_char(drvthis, 3, c);
|
// fill pixel columns from left to right.
|
||||||
serialVFD_set_char(drvthis, 4, d);
|
memset(hBar, 0xFF & ~((1 << (p->cellwidth - i)) - 1), sizeof(hBar));
|
||||||
|
serialVFD_set_char(drvthis, i, hBar);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ MODULE_EXPORT void serialVFD_vbar (Driver *drvthis, int x, int y, int len, int p
|
|||||||
MODULE_EXPORT void serialVFD_hbar (Driver *drvthis, int x, int y, int len, int promille, int options);
|
MODULE_EXPORT void serialVFD_hbar (Driver *drvthis, int x, int y, int len, int promille, int options);
|
||||||
MODULE_EXPORT int serialVFD_icon(Driver *drvthis, int x, int y, int icon);
|
MODULE_EXPORT int serialVFD_icon(Driver *drvthis, int x, int y, int icon);
|
||||||
|
|
||||||
MODULE_EXPORT void serialVFD_set_char (Driver *drvthis, int n, char *dat);
|
MODULE_EXPORT void serialVFD_set_char (Driver *drvthis, int n, unsigned char *dat);
|
||||||
|
|
||||||
MODULE_EXPORT int serialVFD_get_brightness (Driver *drvthis, int state);
|
MODULE_EXPORT int serialVFD_get_brightness (Driver *drvthis, int state);
|
||||||
MODULE_EXPORT void serialVFD_set_brightness (Driver *drvthis, int state, int promille);
|
MODULE_EXPORT void serialVFD_set_brightness (Driver *drvthis, int state, int promille);
|
||||||
|
|||||||
Reference in New Issue
Block a user