Now you can choose between report.h and debug.h (default) If you are happy with it I'll remove debug.h
This commit is contained in:
+30
-4
@@ -34,9 +34,11 @@
|
|||||||
// I don't want to break anything here so let's do it step by step
|
// I don't want to break anything here so let's do it step by step
|
||||||
//#define USE_REPORT
|
//#define USE_REPORT
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
#include "shared/debug.h"
|
//#define DEBUG
|
||||||
#else
|
|
||||||
#include "shared/report.h"
|
#include "shared/report.h"
|
||||||
|
//#undef DEBUG
|
||||||
|
#else
|
||||||
|
#include "shared/debug.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "shared/str.h"
|
#include "shared/str.h"
|
||||||
@@ -471,6 +473,7 @@ MtxOrb_clear ()
|
|||||||
clear = 1;
|
clear = 1;
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: cleared screen");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: cleared screen");
|
syslog(LOG_DEBUG, "MtxOrb: cleared screen");
|
||||||
@@ -491,6 +494,7 @@ MtxOrb_close ()
|
|||||||
MtxOrb->framebuf = NULL;
|
MtxOrb->framebuf = NULL;
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: closed");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: closed");
|
syslog(LOG_DEBUG, "MtxOrb: closed");
|
||||||
@@ -513,6 +517,7 @@ MtxOrb_string (int x, int y, char *string)
|
|||||||
memcpy(MtxOrb->framebuf + offset, string, siz);
|
memcpy(MtxOrb->framebuf + offset, string, siz);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: printed string at (%d,%d)", x, y);
|
||||||
#else
|
#else
|
||||||
if (debug_level > 4)
|
if (debug_level > 4)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: printed string at (%d,%d)", x, y);
|
syslog(LOG_DEBUG, "MtxOrb: printed string at (%d,%d)", x, y);
|
||||||
@@ -525,6 +530,7 @@ MtxOrb_flush ()
|
|||||||
MtxOrb_draw_frame (MtxOrb->framebuf);
|
MtxOrb_draw_frame (MtxOrb->framebuf);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: frame buffer flushed");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 4)
|
if (debug_level > 4)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: frame buffer flushed");
|
syslog(LOG_DEBUG, "MtxOrb: frame buffer flushed");
|
||||||
@@ -543,6 +549,7 @@ MtxOrb_flush_box (int lft, int top, int rgt, int bot)
|
|||||||
write (fd, MtxOrb->framebuf + (y * MtxOrb->wid) + lft, rgt - lft + 1);
|
write (fd, MtxOrb->framebuf + (y * MtxOrb->wid) + lft, rgt - lft + 1);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: frame buffer box flushed");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 4)
|
if (debug_level > 4)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: frame buffer box flushed");
|
syslog(LOG_DEBUG, "MtxOrb: frame buffer box flushed");
|
||||||
@@ -581,10 +588,11 @@ MtxOrb_chr (int x, int y, char c)
|
|||||||
MtxOrb->framebuf[offset] = c;
|
MtxOrb->framebuf[offset] = c;
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "writing character %02X to position (%d,%d)", c, x, y);
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: printed a char at (%d,%d)", x, y);
|
||||||
#else
|
#else
|
||||||
if (debug_level > 2) {
|
if (debug_level > 2) {
|
||||||
snprintf(buf, sizeof(buf), "writing character %02X to position (%d,%d)",
|
snprintf(buf, sizeof(buf), "writing character %02X to position (%d,%d)", c, x, y);
|
||||||
c, x, y);
|
|
||||||
syslog(LOG_DEBUG, buf);
|
syslog(LOG_DEBUG, buf);
|
||||||
|
|
||||||
if (debug_level > 4)
|
if (debug_level > 4)
|
||||||
@@ -614,12 +622,14 @@ MtxOrb_contrast (int contrast)
|
|||||||
write (fd, out, 3);
|
write (fd, out, 3);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: contrast set to %d", contrast);
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: contrast set to %d", contrast);
|
syslog(LOG_DEBUG, "MtxOrb: contrast set to %d", contrast);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: contrast not set to %d - not LCD or LKD display", contrast);
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: contrast not set to %d - not LCD or LKD display", contrast);
|
syslog(LOG_DEBUG, "MtxOrb: contrast not set to %d - not LCD or LKD display", contrast);
|
||||||
@@ -656,6 +666,7 @@ MtxOrb_backlight (int on)
|
|||||||
case BACKLIGHT_ON:
|
case BACKLIGHT_ON:
|
||||||
write (fd, "\x0FE" "F", 2);
|
write (fd, "\x0FE" "F", 2);
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: backlight turned on");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: backlight turned on");
|
syslog(LOG_DEBUG, "MtxOrb: backlight turned on");
|
||||||
@@ -664,6 +675,7 @@ MtxOrb_backlight (int on)
|
|||||||
case BACKLIGHT_OFF:
|
case BACKLIGHT_OFF:
|
||||||
if (IS_VKD_DISPLAY || IS_VFD_DISPLAY) {
|
if (IS_VKD_DISPLAY || IS_VFD_DISPLAY) {
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: backlight ignored - not LCD or LKD display");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: backlight ignored - not LCD or LKD display");
|
syslog(LOG_DEBUG, "MtxOrb: backlight ignored - not LCD or LKD display");
|
||||||
@@ -671,6 +683,7 @@ MtxOrb_backlight (int on)
|
|||||||
; // turns display off entirely (whoops!)
|
; // turns display off entirely (whoops!)
|
||||||
} else {
|
} else {
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: backlight turned off");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: backlight turned off");
|
syslog(LOG_DEBUG, "MtxOrb: backlight turned off");
|
||||||
@@ -680,6 +693,7 @@ MtxOrb_backlight (int on)
|
|||||||
break;
|
break;
|
||||||
default: // ignored...
|
default: // ignored...
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: backlight - invalid setting");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: backlight - invalid setting");
|
syslog(LOG_DEBUG, "MtxOrb: backlight - invalid setting");
|
||||||
@@ -707,6 +721,7 @@ MtxOrb_output (int on)
|
|||||||
output_state = on;
|
output_state = on;
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: output pins set: %04X", on);
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: output pins set: %04X", on);
|
syslog(LOG_DEBUG, "MtxOrb: output pins set: %04X", on);
|
||||||
@@ -743,6 +758,7 @@ MtxOrb_linewrap (int on)
|
|||||||
write (fd, "\x0FE" "C", 2);
|
write (fd, "\x0FE" "C", 2);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: linewrap turned on");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: linewrap turned on");
|
syslog(LOG_DEBUG, "MtxOrb: linewrap turned on");
|
||||||
@@ -751,6 +767,7 @@ MtxOrb_linewrap (int on)
|
|||||||
write (fd, "\x0FE" "D", 2);
|
write (fd, "\x0FE" "D", 2);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: linewrap turned off");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: linewrap turned off");
|
syslog(LOG_DEBUG, "MtxOrb: linewrap turned off");
|
||||||
@@ -768,6 +785,7 @@ MtxOrb_autoscroll (int on)
|
|||||||
write (fd, "\x0FEQ", 2);
|
write (fd, "\x0FEQ", 2);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: autoscroll turned on");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: autoscroll turned on");
|
syslog(LOG_DEBUG, "MtxOrb: autoscroll turned on");
|
||||||
@@ -776,6 +794,7 @@ MtxOrb_autoscroll (int on)
|
|||||||
write (fd, "\x0FER", 2);
|
write (fd, "\x0FER", 2);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: autoscroll turned off");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: autoscroll turned off");
|
syslog(LOG_DEBUG, "MtxOrb: autoscroll turned off");
|
||||||
@@ -794,6 +813,7 @@ MtxOrb_cursorblink (int on)
|
|||||||
write (fd, "\x0FES", 2);
|
write (fd, "\x0FES", 2);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: cursorblink turned on");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: cursorblink turned on");
|
syslog(LOG_DEBUG, "MtxOrb: cursorblink turned on");
|
||||||
@@ -802,6 +822,7 @@ MtxOrb_cursorblink (int on)
|
|||||||
write (fd, "\x0FET", 2);
|
write (fd, "\x0FET", 2);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: cursorblink turned off");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: cursorblink turned off");
|
syslog(LOG_DEBUG, "MtxOrb: cursorblink turned off");
|
||||||
@@ -843,6 +864,7 @@ MtxOrb_getinfo (void)
|
|||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: getinfo");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: getinfo");
|
syslog(LOG_DEBUG, "MtxOrb: getinfo");
|
||||||
@@ -970,6 +992,7 @@ MtxOrb_vbar (int x, int len)
|
|||||||
int y;
|
int y;
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: vertical bar at %d set to %d", x, len);
|
||||||
#else
|
#else
|
||||||
if (debug_level > 4)
|
if (debug_level > 4)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: vertical bar at %d set to %d", x, len);
|
syslog(LOG_DEBUG, "MtxOrb: vertical bar at %d set to %d", x, len);
|
||||||
@@ -1017,6 +1040,7 @@ MtxOrb_hbar (int x, int y, int len)
|
|||||||
ValidY(y);
|
ValidY(y);
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: horizontal bar at %d set to %d", x, len);
|
||||||
#else
|
#else
|
||||||
if (debug_level > 4)
|
if (debug_level > 4)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: horizontal bar at %d set to %d", x, len);
|
syslog(LOG_DEBUG, "MtxOrb: horizontal bar at %d set to %d", x, len);
|
||||||
@@ -1059,6 +1083,7 @@ static void
|
|||||||
MtxOrb_init_num ()
|
MtxOrb_init_num ()
|
||||||
{
|
{
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: init for big numbers");
|
||||||
#else
|
#else
|
||||||
if (debug_level > 3)
|
if (debug_level > 3)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: init for big numbers");
|
syslog(LOG_DEBUG, "MtxOrb: init for big numbers");
|
||||||
@@ -1094,6 +1119,7 @@ MtxOrb_num (int x, int num)
|
|||||||
char out[5];
|
char out[5];
|
||||||
|
|
||||||
#ifdef USE_REPORT
|
#ifdef USE_REPORT
|
||||||
|
debug(RPT_DEBUG, "MtxOrb: write big number %d at %d", num, x);
|
||||||
#else
|
#else
|
||||||
if (debug_level > 4)
|
if (debug_level > 4)
|
||||||
syslog(LOG_DEBUG, "MtxOrb: write big number %d at %d", num, x);
|
syslog(LOG_DEBUG, "MtxOrb: write big number %d at %d", num, x);
|
||||||
|
|||||||
Reference in New Issue
Block a user