word_cnt++;
if(word_cnt < FRAME_LEN)
init_word(current_word);
-
- frame_finished = 1;
+ else
+ frame_finished = 2;
}
//***********//
void send_frame(const word_t w)
{
+ if (frame_finished == 0)
+ for(;;)
+ if (frame_finished)
+ {
+ delay(10);
+ break;
+ }
word_cnt = 0;
frame_finished = 0;
- init_word(w);
-
- for(;;)
- if(frame_finished)
- break;
+ init_word(w);
+}
- Serial.println("Ok");
+void check_frame_done()
+{
+ if (frame_finished==2)
+ {
+ Serial.println("Ok");
+ frame_finished=1;
+ }
}
//********************************************************************//
updateLightLevel(PHOTO_ANALOGPIN);
calculate_led_level(BLUELED_PWM_PIN);
+ check_frame_done();
if(Serial.available()) {
char command = Serial.read();