@@ -21,6 +21,8 @@ millis_t nextstep;
2121millis_t nextsend;
2222
2323uint8_t message[] = { ' J' , ' o' , ' s' , ' h' };
24+
25+ uint8_t errorFlag[ IR_FACE_COUNT ];
2426
2527void loopEntry ( loopstate_in_t const *loopstate_in , loopstate_out_t *loopstate_out) {
2628
@@ -37,6 +39,8 @@ void loopEntry( loopstate_in_t const *loopstate_in , loopstate_out_t *loopstate_
3739 }
3840
3941 loopstate_out->colors [step] = pixelColor_t ( 23 , 10 , 0 , 1 );
42+
43+ errorFlag[step]=0 ;
4044
4145 nextstep = loopstate_in->millis + 200 ;
4246 }
@@ -56,20 +60,32 @@ void loopEntry( loopstate_in_t const *loopstate_in , loopstate_out_t *loopstate_
5660 loopstate_out->colors [f] = pixelColor_t ( 0 , 20 , 0 , 1 );
5761
5862 } else {
59-
60- // Good length, bad data!
61- loopstate_out->colors [f] = pixelColor_t ( 20 , 0 , 0 , 1 );
63+
64+ errorFlag[f] = 2 ;
6265
6366 }
6467
6568 } else {
66-
6769 // Bad len
68- loopstate_out->colors [f] = pixelColor_t ( 0 , 0 , 20 , 1 );
70+
71+ errorFlag[f] = 1 ;
72+
6973
7074 }
7175
7276 }
77+
78+ if (errorFlag[f]==1 ) {
79+
80+ loopstate_out->colors [f] = pixelColor_t ( 20 , 0 , 0 , 1 );
81+
82+
83+ } else if (errorFlag[f]==2 ) {
84+
85+
86+ loopstate_out->colors [f] = pixelColor_t ( 0 , 0 , 20 , 1 );
87+
88+ }
7389
7490 }
7591
0 commit comments