diff --git a/sub_bmp.cpp b/sub_bmp.cpp index ed1cc76..f06d7e8 100644 --- a/sub_bmp.cpp +++ b/sub_bmp.cpp @@ -149,7 +149,7 @@ char *cords; static int px; static bool framed = false; -static bool gct = false; +extern bool gct; void bmp_setpx(int x, int y, int frm, int line) { @@ -241,14 +241,6 @@ void bmp_draw_mask(String path, unsigned long tm) if (path.endsWith(exgif)) { gifheader g = gif_load(path, true); - if (g.cdp) - { - gct = true; - } - else - { - gct = false; - } fps = g.fps; if (fps > 1) { @@ -344,6 +336,7 @@ void bmp_draw_last(int fps) } led_show(); udp_poll(); + delay(10); } void bmp_init() diff --git a/sub_gif.cpp b/sub_gif.cpp index 9bd2e53..11055d3 100644 --- a/sub_gif.cpp +++ b/sub_gif.cpp @@ -22,6 +22,7 @@ static int pofs; static uint8_t block[256]; static uint16_t bt, bi, lzb, lz, last; static uint32_t mil; +bool gct = false; static void freeall() { @@ -165,10 +166,12 @@ struct gifheader gif_load(String path, bool ld) if (ans.flag & 0b10000000) //global color table { ans.cdp = ans.flag & 0b111; + gct = true; } else { ans.cdp = 0; + gct = false; } if (ld == false) goto exitreadgif; freeall(); diff --git a/sub_led.cpp b/sub_led.cpp index 150fcf0..05c14cb 100644 --- a/sub_led.cpp +++ b/sub_led.cpp @@ -163,13 +163,13 @@ void led_init() void led_blinkudp() { - strip0->ClearTo(red); - strip2->ClearTo(orange); - if (strip4 != NULL) strip4->ClearTo(yellow); + strip0->ClearTo(red); strip0->SetPixelColor(0, green); + strip2->ClearTo(red); for(int i = 0; i <= 2; i++) strip2->SetPixelColor(i, green); + if (strip4 != NULL){ strip4->ClearTo(red); for(int i = 0; i <= 4; i++) strip4->SetPixelColor(i, green);} - strip1->ClearTo(blue); - strip3->ClearTo(wblue); - if (strip5 != NULL) strip5->ClearTo(cyan); + strip1->ClearTo(blue); for(int i = 0; i <= 1; i++) strip1->SetPixelColor(i, green); + strip3->ClearTo(blue); for(int i = 0; i <= 3; i++) strip3->SetPixelColor(i, green); + if (strip5 != NULL){ strip5->ClearTo(blue); for(int i = 0; i <= 5; i++) strip5->SetPixelColor(i, green);} led_show(); }