Skip to content

Commit 696c1e5

Browse files
committed
fix SSD1306AsciiOut clear
and some polising
1 parent 6de33b9 commit 696c1e5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

examples/SSD1306Ascii/SSD1306Ascii/SSD1306Ascii.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ int test=55;
2727
result action1(eventMask e) {
2828
Serial.print(e);
2929
Serial.println(" action1 executed, proceed menu");Serial.flush();
30+
trace(if (e==enterEvent) oled.clear(0,oled.displayWidth(),2,3));
3031
return proceed;
3132
}
3233

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

104105
#ifdef LOC
105-
#define LARGE_FONT
106+
// #define LARGE_FONT
106107
#define INV
107108
#endif
108109

@@ -114,7 +115,7 @@ MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
114115
// #define menuFont System5x7
115116
#define menuFont lcd5x7
116117
#define fontW 5
117-
#define fontH 9
118+
#define fontH 8
118119
#endif
119120

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

138139
//macro to create navigation control root object (nav) using mainMenu

src/menuIO/SSD1306AsciiOut.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
panels.reset();
4242
}
4343
void clear(idx_t panelNr) override {
44-
trace(Serial<<"clear panel!! "<<panelNr<<endl;);
4544
const panel p=panels[panelNr];
46-
device->clear(p.x,p.y,p.x+p.w-1,p.y+p.h-1);
45+
trace(Serial<<"clear panel!! "<<panelNr<<"{"<<p.x<<","<<p.y<<","<<p.w<<","<<p.h<<"}"<<endl;);
46+
device->clear(resX*p.x,resX*(p.x+p.w)-1,resY*p.y,resY*(p.y+p.h)-1);
4747
// setCursor(0,0,panelNr);
4848
panels.nodes[panelNr]=NULL;
4949
}

0 commit comments

Comments
 (0)