Skip to content

Commit 9a134e9

Browse files
Deomid Ryabkovcpq
authored andcommitted
Cleanup demo a bit
PUBLISHED_FROM=324a014f86ccca9bbe61e4033f4ee8ada07b2445
1 parent e5fea5e commit 9a134e9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

platforms/esp8266/user/esp_mg_net_if.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,15 @@ time_t mg_mgr_poll(struct mg_mgr *mgr, int timeout_ms) {
391391
for (nc = mgr->active_connections; nc != NULL; nc = tmp) {
392392
tmp = nc->next;
393393
n++;
394-
if ((nc->flags & MG_F_CLOSE_IMMEDIATELY) ||
395-
(nc->send_mbuf.len == 0 && (nc->flags & MG_F_SEND_AND_CLOSE))) {
394+
if (nc->flags & MG_F_CLOSE_IMMEDIATELY) {
396395
mg_close_conn(nc);
397396
continue;
398397
}
399398
mg_if_poll(nc, now);
399+
if (nc->send_mbuf.len == 0 && (nc->flags & MG_F_SEND_AND_CLOSE)) {
400+
mg_close_conn(nc);
401+
continue;
402+
}
400403
if (!(nc->flags & (MG_F_CONNECTING | MG_F_UDP))) {
401404
if (nc->send_mbuf.len > 0) mg_lwip_tcp_write(nc);
402405
}

src/js/MCXXX_LCD.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
* Datasheet: http://goo.gl/3C5rR2
44
*/
55

6-
function MCXXX(i2c, numLines, numCols) {
6+
function MCXXX(i2c, numLines, numCols, resetPin) {
77
var icon_on = false;
88
var lines = [];
99

1010
this.init = function(display_on, cursor_on, cursor_blink, contrast) {
11+
if (resetPin !== undefined) {
12+
GPIO.setmode(resetPin, 2, 0);
13+
GPIO.write(resetPin, 0);
14+
GPIO.write(resetPin, 1);
15+
}
1116
return sendInsn([
1217
I_FCS(2, false, 1),
1318
I1_SET_OSC_FREQ(0, 4),

0 commit comments

Comments
 (0)