void update_time_in_buffer(void) { int buffer_time_dec, t4; //just two temp. var. // Convert 20h53m to 2053 buffer_time_dec = count_hours_for_clock*100 + count_minutes_for_clock; // For 4 digit for (t4=4;t4!=0;t4--) { // Next, we replace the image of the digit and restore the position on the screen buffer_line_to_leds [t4-1] = ((dec_digit_to_7_seg_led [buffer_time_dec % 10])<<8) + (0x01<<(8-t4)); buffer_time_dec = buffer_time_dec / 10; } // Next, turn on the "dot" between the hours and minutes. buffer_line_to_leds[2] = buffer_line_to_leds [2] & 0xFEFF; // Last, we turn off 0 if it is in the first position. if((buffer_line_to_leds[0] & 0xFF00) == 0x0300) buffer_line_to_leds [0] = 0xFF00; }