Skip to content

Commit

Permalink
[calibration] Prettier screen
Browse files Browse the repository at this point in the history
  • Loading branch information
mean committed Sep 10, 2019
1 parent c619093 commit 2384703
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
25 changes: 11 additions & 14 deletions dso_calibrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ static void waitOk()
}
}

/**
*
* @param array
*/
static void printxy(int x, int y, const char *t)
{
tft->setCursor(x, y);
tft->myDrawString(t);
}
/**
*/
static void printCalibrationTemplate( const char *st1, const char *st2)
Expand Down Expand Up @@ -148,7 +139,8 @@ bool DSOCalibrate::zeroCalibrate()
doCalibrate(calibrationAC,GREEN, "",DSOControl::DSO_COUPLING_AC);
DSOEeprom::write();
tft->fillScreen(0);
printxy(20,100,"Restart the unit.");
DSO_GFX::printxy(20,100,"Restart the unit.");
while(1) {};
return true;
}
/**
Expand Down Expand Up @@ -259,6 +251,11 @@ float performVoltageCalibration(const char *title, float expected,float defalt,f
{
#define SCALEUP 1000000
fineHeader(title);

DSO_GFX::printxy(200,70,"@ ADC @");
DSO_GFX::printxy(10,70, "@ Scale @");
DSO_GFX::printxy(10,110,"@Default@");
DSO_GFX::printxy(10,140,"@PrevVal@s");
while(1)
{ // Raw read
int sum=averageADCRead();
Expand All @@ -269,13 +266,13 @@ float performVoltageCalibration(const char *title, float expected,float defalt,f
f=expected/sum;

tft->setCursor(200, 90);
tft->print(sum);
tft->print(sum); tft->print(" ");
tft->setCursor(10, 90);
tft->print(f*SCALEUP);
tft->print(f*SCALEUP);tft->print(" ");
tft->setCursor(10, 130);
tft->print(defalt*SCALEUP);
tft->print(defalt*SCALEUP);tft->print(" ");
tft->setCursor(10, 160);
tft->print(previous*SCALEUP);
tft->print(previous*SCALEUP);tft->print(" ");


if( SHORT_PRESS(DSO_BUTTON_OK))
Expand Down
9 changes: 9 additions & 0 deletions dso_gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ void DSO_GFX::center(const char *p,int y)
markup(p);
}

/**
*
* @param array
*/
void DSO_GFX::printxy(int x, int y, const char *t)
{
tft->setCursor(x, y);
markup(t);
}
/**
*
* @param title
Expand Down
1 change: 1 addition & 0 deletions dso_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ class DSO_GFX
static void bottomLine(const char *title);
static void markup(const char *title);
static void center(const char *p,int y);
static void printxy(int x, int y, const char *t);

};

0 comments on commit 2384703

Please sign in to comment.