cur_cnt           111 core/usb_sync.c         int cur_cnt = *(volatile int*)(GPIO_VSYNC_CURRENT) & 0xffff; // get the counter state at the time of sync
cur_cnt           113 core/usb_sync.c         int sync_period = std_period * 2 + cur_cnt;                  // schedule the end of extended period at t = t(synch pulse) + sync_time
cur_cnt           115 core/usb_sync.c         if (std_period - cur_cnt < 10)                               // if too close to overflow, wait for the next period
cur_cnt           117 core/usb_sync.c             sync_period -= (std_period - cur_cnt);
cur_cnt           118 core/usb_sync.c             while ((*(volatile int*)(GPIO_VSYNC_CURRENT) & 0xffff) >= cur_cnt) {};