Skip to content

Commit

Permalink
fix SSD1306AsciiOut clear
Browse files Browse the repository at this point in the history
and some polising
  • Loading branch information
neu-rah committed Aug 19, 2018
1 parent 6de33b9 commit 696c1e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions examples/SSD1306Ascii/SSD1306Ascii/SSD1306Ascii.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ int test=55;
result action1(eventMask e) {
Serial.print(e);
Serial.println(" action1 executed, proceed menu");Serial.flush();
trace(if (e==enterEvent) oled.clear(0,oled.displayWidth(),2,3));
return proceed;
}

Expand Down Expand Up @@ -102,7 +103,7 @@ MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
#define MAX_DEPTH 2

#ifdef LOC
#define LARGE_FONT
// #define LARGE_FONT
#define INV
#endif

Expand All @@ -114,7 +115,7 @@ MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
// #define menuFont System5x7
#define menuFont lcd5x7
#define fontW 5
#define fontH 9
#define fontH 8
#endif

//define output device
Expand All @@ -132,7 +133,7 @@ idx_t tops[MAX_DEPTH]={0,0};//store cursor positions for each level
#else
SSD1306AsciiOut outOLED(&oled,tops,pList,5,1);//oled output device menu driver
#endif
menuOut* constMEM outputs[] MEMMODE ={&outOLED};//,&outSerial};//list of output devices
menuOut* constMEM outputs[] MEMMODE ={&outOLED,&outSerial};//list of output devices
outputsList out(outputs,sizeof(outputs)/sizeof(menuOut*));//outputs list

//macro to create navigation control root object (nav) using mainMenu
Expand Down
4 changes: 2 additions & 2 deletions src/menuIO/SSD1306AsciiOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
panels.reset();
}
void clear(idx_t panelNr) override {
trace(Serial<<"clear panel!! "<<panelNr<<endl;);
const panel p=panels[panelNr];
device->clear(p.x,p.y,p.x+p.w-1,p.y+p.h-1);
trace(Serial<<"clear panel!! "<<panelNr<<"{"<<p.x<<","<<p.y<<","<<p.w<<","<<p.h<<"}"<<endl;);
device->clear(resX*p.x,resX*(p.x+p.w)-1,resY*p.y,resY*(p.y+p.h)-1);
// setCursor(0,0,panelNr);
panels.nodes[panelNr]=NULL;
}
Expand Down

0 comments on commit 696c1e5

Please # to comment.