@@ -59,10 +59,10 @@ Display::Display()
59
59
void Display::start () {
60
60
prettyClean ();
61
61
62
- // if (epd_.Init(/* lut_partial_update*/ ) != 0) {
63
- // ESP_LOGE(TAG, "e-Paper init failed");
64
- // return;
65
- // }
62
+ if (epd_.Init (lut_partial_update) != 0 ) {
63
+ ESP_LOGE (TAG, " e-Paper init failed" );
64
+ return ;
65
+ }
66
66
67
67
start_execution (TAG);
68
68
}
@@ -112,31 +112,14 @@ void Display::draw() {
112
112
std::chrono::system_clock::now ();
113
113
#endif
114
114
115
- // epd_.SetFrameMemory(front_, 0, 0, epd_.width, epd_.height);
116
-
117
- static int cnt = 0 ;
118
- const int msg_size = 128 ;
119
- char message[msg_size];
120
-
121
- cnt++;
122
-
123
- snprintf (message, msg_size, " %d %d %d" , cnt, 10 * cnt + cnt, rand ());
124
-
125
- paint_.SetWidth (128 );
126
- paint_.SetHeight (296 );
127
- paint_.SetRotate (ROTATE_90);
128
-
129
- paint_.Clear (UNCOLORED);
130
- paint_.DrawStringAt (0 , 0 , message, &Font24, COLORED);
131
- epd_.SetFrameMemory_Partial (paint_.GetImage (), 0 , 0 , paint_.GetWidth (), paint_.GetHeight ());
115
+ epd_.SetFrameMemory (front_, 0 , 0 , epd_.width , epd_.height );
132
116
133
117
#if defined(PERF)
134
118
std::chrono::time_point<std::chrono::system_clock> after_set_frame =
135
119
std::chrono::system_clock::now ();
136
120
#endif
137
121
138
- epd_.DisplayFrame_Partial ();
139
- // epd_.DisplayFrame();
122
+ epd_.DisplayFrame ();
140
123
141
124
std::chrono::time_point<std::chrono::system_clock> after_display =
142
125
std::chrono::system_clock::now ();
@@ -174,40 +157,15 @@ void Display::prepareCanvas(const Rect& rect) {
174
157
}
175
158
176
159
void Display::prettyClean () {
177
- if (epd_.Init (/* lut_full_update*/ ) != 0 ) {
160
+ if (epd_.Init (lut_full_update) != 0 ) {
178
161
ESP_LOGE (TAG, " e-Paper initialization failed" );
179
162
return ;
180
163
}
181
164
182
165
epd_.ClearFrameMemory (0xFF );
183
166
epd_.DisplayFrame ();
184
- // epd_.ClearFrameMemory(0xFF);
185
- // epd_.DisplayFrame();
186
-
187
- paint_.SetRotate (ROTATE_90);
188
- paint_.SetWidth (128 );
189
- paint_.SetHeight (296 );
190
-
191
- // /* For simplicity, the arguments are explicit numerical coordinates */
192
- // paint_.Clear(COLORED);
193
- // paint_.DrawStringAt(0, 4, "Hello world!", &Font12, UNCOLORED);
194
- // epd_.SetFrameMemory(paint_.GetImage(), 0, 10, paint_.GetWidth(), paint_.GetHeight());
195
-
196
- // paint_.Clear(UNCOLORED);
197
- // paint_.DrawStringAt(0, 4, "e-Paper Demo", &Font24, COLORED);
198
- // epd_.SetFrameMemory_Partial(paint_.GetImage(), 0, 0, paint_.GetWidth(),
199
- // paint_.GetHeight());
200
- // epd_.DisplayFrame();
201
- // epd_.DisplayFrame_Partial();
202
-
203
- // paint_.SetWidth(32);
204
- // paint_.SetHeight(96);
205
- // paint_.SetRotate(ROTATE_90);
206
-
207
- // paint_.Clear(UNCOLORED);
208
- // paint_.DrawStringAt(0, 4, "TESTO", &Font24, COLORED);
209
- // epd_.SetFrameMemory_Partial(paint_.GetImage(), 80, 72, paint_.GetWidth(),
210
- // paint_.GetHeight()); epd_.DisplayFrame_Partial();
167
+ epd_.ClearFrameMemory (0xFF );
168
+ epd_.DisplayFrame ();
211
169
}
212
170
213
171
void Display::swapBuffers () {
0 commit comments