45 #define MS_PER_FRAME (1000/DEVICE_FPS) 106 #endif //FRAME_TIMER_H bool should_draw_frame()
Whether a new frame should be displayed or if the device is allowed to idle.
void correct_display_frame_phase(const int8_t ms_shift)
Shift the frame display phase with respect to the USB frame counter.
uint16_t display_frame_counter
Counter that is incremented once per frame draw, i.e. nominally every 40ms.
Definition: frame_timer.h:63
void clear_draw_frame()
Acknowledge that a frame has been drawn.
bool correct_display_frame_counter(const int16_t frame_diff)
Correct the display frame counter.
void new_sof_received(const uint16_t usb_frame_counter)
Function to be called upon receival of a USB SOF token with the new USB frame counter value...
void init_frame_timer()
Initialise the frame timer.
bool get_display_frame_usb_phase(struct display_frame_usb_phase_t *usb_phase)
Latest display frame counter phase.
Display frame counter and USB frame counter values at frame draw time.
Definition: frame_timer.h:61
uint16_t usb_frame_counter
Value of the USB frame counter when the frame is drawn, providing a common ms time base for all USB d...
Definition: frame_timer.h:66