Skip to content

Commit

Permalink
Changed DBG to just D, also replaced D2 with DH (dump hex).
Browse files Browse the repository at this point in the history
  • Loading branch information
kbahey committed May 23, 2018
1 parent 6885a1d commit 337bfb8
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 76 deletions.
26 changes: 13 additions & 13 deletions Align.ino
Original file line number Diff line number Diff line change
Expand Up @@ -677,21 +677,21 @@ bool TGeoAlign::addStar(int I, int N, double RA, double Dec) {
#ifdef GOTO_ASSIST_DEBUG_ON
char s[80];
double f;
DBG((char)(I-1+'0'));
DBG(" Mount h");
f=mount[I-1].ha*Rad/15.0; if (f<0) f=f+24.0; doubleToHms(s,&f); DBG(s);
DBG(",d");
f=mount[I-1].dec*Rad; doubleToDms(s,&f,false,true); DBG(s);
DBG(" Actual h");
f=actual[I-1].ha*Rad/15.0; if (f<0) f=f+24.0; doubleToHms(s,&f); DBG(s);
DBG(",d");
f=actual[I-1].dec*Rad; doubleToDms(s,&f,false,true); DBGL(s);
D((char)(I-1+'0'));
D(" Mount h");
f=mount[I-1].ha*Rad/15.0; if (f<0) f=f+24.0; doubleToHms(s,&f); D(s);
D(",d");
f=mount[I-1].dec*Rad; doubleToDms(s,&f,false,true); D(s);
D(" Actual h");
f=actual[I-1].ha*Rad/15.0; if (f<0) f=f+24.0; doubleToHms(s,&f); D(s);
D(",d");
f=actual[I-1].dec*Rad; doubleToDms(s,&f,false,true); DL(s);
#endif

// two or more stars and finished
if ((I>=2) && (I==N)) {
#ifdef GOTO_ASSIST_DEBUG_ON
DBGL("");
DL("");
#endif
autoModel(N);
// if (syncEqu(RA,Dec)!=0) { return false; }
Expand Down Expand Up @@ -929,10 +929,10 @@ void TGeoAlign::autoModel(int n) {
tfCor=best_tf/3600.0;

#ifdef GOTO_ASSIST_DEBUG_ON
DBGL("");
DL("");
char s[80];
DBG("Model Error =");
dtostrf(best_dist*Rad*60.0,6,2,s); DBGL(s);
D("Model Error =");
dtostrf(best_dist*Rad*60.0,6,2,s); DL(s);
#endif

// offset corrections: doesn't matter, a sync will override this
Expand Down
20 changes: 12 additions & 8 deletions Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,21 @@ unsigned int StepsTMC2130[LEN_TMC2130][2] = { {1,8}, {2,7}, {4,6}, {8,5}, {16,4}
// Library
// Catalog storage starts at 200+PECBufferSize and fills EEPROM

// Unique identifier for the current initialization format for NV, do not change
#define initKey 915307548

// Helper macros for debugging, with less typing.
// To use them, uncomment the DEBUG define in OnStep.ino
#if defined(DEBUG_ON)
#define DBG(x) DebugSer.print(x)
#define DBG2(x,y) DebugSer.print(x,y)
#define DBGL(x) DebugSer.println(x)
#define DBGL2(x,y) DebugSer.println(x,y)
#define D(x) DebugSer.print(x)
#define DH(x) DebugSer.print(x,HEX)
#define DL(x) DebugSer.println(x)
#define DHL(x,y) DebugSer.println(x,HEX)
#else
#define DBG(x) /* nothing */
#define DBG2(x,y) /* nothing */
#define DBGL(x) /* nothing */
#define DBGL2(x,y) /* nothing */
#define D(x)
#define DH(x,y)
#define DL(x)
#define DHL(x,y)
#endif


24 changes: 15 additions & 9 deletions Initialize.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,21 @@ void Init_Startup_Values() {
#endif

#ifdef DEBUG_AXIS_MODES_ON
DBGL("A reminder: TMC_LOWPWR=64, TMC_STEALTHCHOP=32");

DBG2("AXIS1_MODE=",AXIS1_MODE);
DBG2(", AXIS1_MODE_GOTO=",AXIS1_MODE_GOTO);
DBGL2(", AXIS1_STEP_GOTO=",AXIS1_STEP_GOTO);

DBG2("AXIS2_MODE=",AXIS2_MODE);
DBG2(", AXIS2_MODE_GOTO=",AXIS2_MODE_GOTO);
DBGL2(", AXIS2_STEP_GOTO=",AXIS2_STEP_GOTO);
DL("A reminder: TMC_LOWPWR=64, TMC_STEALTHCHOP=32");

D("AXIS1_MODE=");
D(AXIS1_MODE);
D(", AXIS1_MODE_GOTO=");
D(AXIS1_MODE_GOTO);
D(", AXIS1_STEP_GOTO=");
DL(AXIS1_STEP_GOTO);

D("AXIS2_MODE=");
D(AXIS2_MODE);
D(", AXIS2_MODE_GOTO=");
D(AXIS2_MODE_GOTO);
D(", AXIS2_STEP_GOTO=");
DL(AXIS2_STEP_GOTO);
#endif

// initialize some fixed-point values
Expand Down
9 changes: 6 additions & 3 deletions OnStep.ino
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,12 @@ tmc2130 tmcAxis2(Axis2_M2,Axis2_M1,Axis2_Aux,Axis2_M0);
#include "src/lib/Weather.h"
weather ambient;

// forces initialialization of a host of settings in nv. OnStep does this automatically, most likely, you will want to leave this alone
#define INIT_KEY false // set to true to keep automatic initilization from happening. This is a one-time operation... upload to the Arduino, then set to false and upload again
#define initKey 915307548 // unique identifier for the current initialization format, do not change
// Forces initialialization of a host of settings in nv. OnStep does this automatically,
// most likely, you will want to leave this alone
// set to true to keep automatic initilization from happening.
// This is a one-time operation: change to true, upload to the MCU, then set to false
// and upload again
#define INIT_KEY false

void setup() {

Expand Down
16 changes: 8 additions & 8 deletions addons/St4Serial/SmartHandController/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

// helper macros for debugging, with less typing
#if defined(DEBUG_ON)
#define DBG(x) DebugSer.print(x)
#define DBG2(x,y) DebugSer.print(x,y)
#define DBGL(x) DebugSer.println(x)
#define DBGL2(x,y) DebugSer.println(x,y)
#define D(x) DebugSer.print(x)
#define DH(x,y) DebugSer.print(x,HEX)
#define DL(x) DebugSer.println(x)
#define DHL(x,y) DebugSer.println(x,HEX)
#else
#define DBG(x) /* nothing */
#define DBG2(x,y) /* nothing */
#define DBGL(x) /* nothing */
#define DBGL2(x,y) /* nothing */
#define D(x)
#define DH(x,y)
#define DL(x)
#define DHL(x,y)
#endif

70 changes: 35 additions & 35 deletions addons/St4Serial/SmartHandController/Pad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,187 +5,187 @@ byte eventbuttons[7] = { E_NONE ,E_NONE ,E_NONE ,E_NONE ,E_NONE ,E_NONE ,E_NONE

void click_s() {
eventbuttons[B_SHIFT] = E_CLICK;
DBGL("Button s click.");
DL("Button s click.");
} // click2

void doubleclick_s() {
eventbuttons[B_SHIFT] = E_DOUBLECLICK;
DBGL("Button s doubleclick.");
DL("Button s doubleclick.");
} // doubleclick2

void longPressStart_s() {
eventbuttons[B_SHIFT] = E_LONGPRESSTART;
DBGL("Button s longPress start");
DL("Button s longPress start");
} // longPressStart2

void longPress_s() {
eventbuttons[B_SHIFT] = E_LONGPRESS;
DBGL("Button s longPress...");
DL("Button s longPress...");
} // longPress2

void longPressStop_s() {
eventbuttons[B_SHIFT] = E_LONGPRESSSTOP;
DBGL("Button s longPress stop");
DL("Button s longPress stop");
} // longPressStop2


//------------------------------------------------------------------------------
void click_N() {
eventbuttons[B_NORTH] = E_CLICK;
DBGL("Button N click.");
DL("Button N click.");
} // click2

//void doubleclick_N() {
// eventbuttons[B_NORTH] = E_DOUBLECLICK;
//#ifdef DEBUGBUTTON
// DBGL("Button N doubleclick.");
// DL("Button N doubleclick.");
//#endif // DEBUGBUTTON
//} // doubleclick2

void longPressStart_N() {
eventbuttons[B_NORTH] = E_LONGPRESSTART;
DBGL("Button N longPress start");
DL("Button N longPress start");
} // longPressStart2

void longPress_N() {
eventbuttons[B_NORTH] = E_LONGPRESS;
DBGL("Button N longPress...");
DL("Button N longPress...");
} // longPress2

void longPressStop_N() {
eventbuttons[B_NORTH] = E_LONGPRESSSTOP;
DBGL("Button N longPress stop");
DL("Button N longPress stop");
} // long

//------------------------------------------------------------------------------
void click_S() {
eventbuttons[B_SOUTH] = E_CLICK;
DBGL("Button S click.");
DL("Button S click.");
} // click2

//void doubleclick_S() {
// eventbuttons[B_SOUTH] = E_DOUBLECLICK;
// DBGL("Button S doubleclick.");
// DL("Button S doubleclick.");
//} // doubleclick2

void longPressStart_S() {
eventbuttons[B_SOUTH] = E_LONGPRESSTART;
DBGL("Button S longPress start");
DL("Button S longPress start");
} // longPressStart2

void longPress_S() {
eventbuttons[B_SOUTH] = E_LONGPRESS;
DBGL("Button S longPress...");
DL("Button S longPress...");
} // longPress2

void longPressStop_S() {
eventbuttons[B_SOUTH] = E_LONGPRESSSTOP;
DBGL("Button S longPress stop");
DL("Button S longPress stop");
} // long


//------------------------------------------------------------------------------
void click_E() {
eventbuttons[B_EAST] = E_CLICK;
DBGL("Button E click.");
DL("Button E click.");
} // click2

//void doubleclick_E() {
// eventbuttons[B_EAST] = E_DOUBLECLICK;
// DBGL("Button E doubleclick.");
// DL("Button E doubleclick.");
//} // doubleclick2

void longPressStart_E() {
eventbuttons[B_EAST] = E_LONGPRESSTART;
DBGL("Button E longPress start");
DL("Button E longPress start");
} // longPressStart2

void longPress_E() {
eventbuttons[B_EAST] = E_LONGPRESS;
DBGL("Button E longPress...");
DL("Button E longPress...");
} // longPress2

void longPressStop_E() {
eventbuttons[B_EAST] = E_LONGPRESSSTOP;
DBGL("Button E longPress stop");
DL("Button E longPress stop");
} // long

//------------------------------------------------------------------------------
void click_W() {
eventbuttons[B_WEST] = E_CLICK;
DBGL("Button W click.");
DL("Button W click.");
} // click2

//void doubleclick_W() {
// eventbuttons[B_WEST] = E_DOUBLECLICK;
// DBGL("Button W doubleclick.");
// DL("Button W doubleclick.");
//} // doubleclick2

void longPressStart_W() {
eventbuttons[B_WEST] = E_LONGPRESSTART;
DBGL("Button W longPress start");
DL("Button W longPress start");
} // longPressStart2

void longPress_W() {
eventbuttons[B_WEST] = E_LONGPRESS;
DBGL("Button W longPress...");
DL("Button W longPress...");
} // longPress2

void longPressStop_W() {
eventbuttons[B_WEST] = E_LONGPRESSSTOP;
DBGL("Button W longPress stop");
DL("Button W longPress stop");
} // long

//------------------------------------------------------------------------------
void click_F() {
eventbuttons[B_F] = E_CLICK;
DBGL("Button F click.");
DL("Button F click.");
} // click2

void doubleclick_F() {
eventbuttons[B_F] = E_DOUBLECLICK;
DBGL("Button F doubleclick.");
DL("Button F doubleclick.");
} // doubleclick2

void longPressStart_F() {
eventbuttons[B_F] = E_LONGPRESSTART;
DBGL("Button F longPress start");
DL("Button F longPress start");
} // longPressStart2

void longPress_F() {
eventbuttons[B_F] = E_LONGPRESS;
DBGL("Button F longPress...");
DL("Button F longPress...");
} // longPress2

void longPressStop_F() {
eventbuttons[B_F] = E_LONGPRESSSTOP;
DBGL("Button F longPress stop");
DL("Button F longPress stop");
} // long

//------------------------------------------------------------------------------
void click_f() {
eventbuttons[B_f] = E_CLICK;
DBGL("Button f click.");
DL("Button f click.");
} // click2

void doubleclick_f() {
eventbuttons[B_f] = E_DOUBLECLICK;
DBGL("Button f doubleclick.");
DL("Button f doubleclick.");
} // doubleclick2

void longPressStart_f() {
eventbuttons[B_f] = E_LONGPRESSTART;
DBGL("Button f longPress start");
DL("Button f longPress start");
} // longPressStart2

void longPress_f() {
eventbuttons[B_f] = E_LONGPRESS;
DBGL("Button f longPress...");
DL("Button f longPress...");
} // longPress2

void longPressStop_f() {
eventbuttons[B_f] = E_LONGPRESSSTOP;
DBGL("Button f longPress stop");
DL("Button f longPress stop");
} // long

//------------------------------------------------------------------------------
Expand Down

0 comments on commit 337bfb8

Please sign in to comment.