Skip to content

Commit c5418ba

Browse files
committed
minor fix
1 parent 9913556 commit c5418ba

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

sub_bmp.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ char *cords;
149149

150150
static int px;
151151
static bool framed = false;
152-
static bool gct = false;
152+
extern bool gct;
153153

154154
void bmp_setpx(int x, int y, int frm, int line)
155155
{
@@ -241,14 +241,6 @@ void bmp_draw_mask(String path, unsigned long tm)
241241
if (path.endsWith(exgif))
242242
{
243243
gifheader g = gif_load(path, true);
244-
if (g.cdp)
245-
{
246-
gct = true;
247-
}
248-
else
249-
{
250-
gct = false;
251-
}
252244
fps = g.fps;
253245
if (fps > 1)
254246
{
@@ -344,6 +336,7 @@ void bmp_draw_last(int fps)
344336
}
345337
led_show();
346338
udp_poll();
339+
delay(10);
347340
}
348341

349342
void bmp_init()

sub_gif.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ static int pofs;
2222
static uint8_t block[256];
2323
static uint16_t bt, bi, lzb, lz, last;
2424
static uint32_t mil;
25+
bool gct = false;
2526

2627
static void freeall()
2728
{
@@ -165,10 +166,12 @@ struct gifheader gif_load(String path, bool ld)
165166
if (ans.flag & 0b10000000) //global color table
166167
{
167168
ans.cdp = ans.flag & 0b111;
169+
gct = true;
168170
}
169171
else
170172
{
171173
ans.cdp = 0;
174+
gct = false;
172175
}
173176
if (ld == false) goto exitreadgif;
174177
freeall();

sub_led.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ void led_init()
163163

164164
void led_blinkudp()
165165
{
166-
strip0->ClearTo(red);
167-
strip2->ClearTo(orange);
168-
if (strip4 != NULL) strip4->ClearTo(yellow);
166+
strip0->ClearTo(red); strip0->SetPixelColor(0, green);
167+
strip2->ClearTo(red); for(int i = 0; i <= 2; i++) strip2->SetPixelColor(i, green);
168+
if (strip4 != NULL){ strip4->ClearTo(red); for(int i = 0; i <= 4; i++) strip4->SetPixelColor(i, green);}
169169

170-
strip1->ClearTo(blue);
171-
strip3->ClearTo(wblue);
172-
if (strip5 != NULL) strip5->ClearTo(cyan);
170+
strip1->ClearTo(blue); for(int i = 0; i <= 1; i++) strip1->SetPixelColor(i, green);
171+
strip3->ClearTo(blue); for(int i = 0; i <= 3; i++) strip3->SetPixelColor(i, green);
172+
if (strip5 != NULL){ strip5->ClearTo(blue); for(int i = 0; i <= 5; i++) strip5->SetPixelColor(i, green);}
173173

174174
led_show();
175175
}

0 commit comments

Comments
 (0)