From cba474a990b7241a0595f0648a292e9955f65f28 Mon Sep 17 00:00:00 2001 From: "Alexey N. Vinogradov" Date: Thu, 21 Mar 2019 22:49:59 +0700 Subject: [PATCH] Comment in rastertozj.c Add symbolic commands in comments (for more clear understanding about) --- rastertozj.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/rastertozj.c b/rastertozj.c index 26ee84a..7c4f288 100644 --- a/rastertozj.c +++ b/rastertozj.c @@ -24,18 +24,28 @@ struct command { char *command; }; +/* + * zj uses kind of epson ESC/P dialect code. Here is subset of commands + * + * initialize - esc @ + * cash drawer 1 - esc p 0 @ P + * cash drawer 2 - esc p 1 @ P + * start raster - esc v 0 + * skip lines - esc j + * cut - esc i + */ // define printer initialize command static const struct command printerInitializeCommand = {2, - (char[2]){0x1b, 0x40}}; + (char[2]){0x1b, 0x40}}; // esc @ // define cashDrawerEjector command static const struct command cashDrawerEject[2] = { - {5, (char[5]){0x1b, 0x70, 0, 0x40, 0x50}}, + {5, (char[5]){0x1b, 0x70, 0, 0x40, 0x50}}, // esc p N @ P {5, (char[5]){0x1b, 0x70, 1, 0x40, 0x50}}}; // define raster mode start command static const struct command rasterModeStartCommand = { - 4, (char[4]){0x1d, 0x76, 0x30, 0}}; + 4, (char[4]){0x1d, 0x76, 0x30, 0}}; // esc v 0 #ifndef DEBUGP @@ -82,7 +92,7 @@ static inline void rasterheader(int xsize, int ysize) { // then feed given number of lines static inline void skiplines(int size) { mputchar(0x1b); - mputchar(0x4a); + mputchar(0x4a); // esc j mputchar(size); }