Nominally, the display consumes frame from its internal queue at 25 frames per second.
When the device is connected to a USB host, it can also track the timer interval corresponding to 40ms. To achieve this synchronisation, new_sof_received() should be called every (few) SOF token(s). The number of clock ticks between these calls will be monitored and averaged out to slave the 25FPS timer to the USB SOF timer.
Using the correct_display_frame_counter() and correct_display_frame_phase() functions, all display segments can be made to update within 1ms from each other. These phase corrections can be performed remotely by sending a FRAME_DRAW_SYNC request to the control endpoint. Note that tearing can still occur if no mechanism is present to tell the segments when the remotely rendered data should be displayed.