|
|
@ -114,6 +114,7 @@ static uint32_t second; |
|
|
|
|
|
|
|
static uint32_t dtimes(timecode_parse_result_t *a, timecode_parse_result_t *b, bool *newday) { |
|
|
|
if (b->timeinall >= a->timeinall) { |
|
|
|
*newday = false; |
|
|
|
return b->timeinall - a->timeinall; |
|
|
|
} else { |
|
|
|
*newday = true; |
|
|
@ -133,11 +134,10 @@ static void try_report_device_info_packet() { |
|
|
|
static void xync_signal_report_thread(void const *argument) { |
|
|
|
while (true) { |
|
|
|
osEvent signal = osSignalWait(0x07, 100); |
|
|
|
if (signal.value.signals == 0x01) { |
|
|
|
if (signal.value.signals & 0x01) { |
|
|
|
uint32_t tc0; |
|
|
|
uint32_t tc1; |
|
|
|
uint32_t cnt; |
|
|
|
|
|
|
|
fpga_if_spi_read_data_02(camera_sync_timecode_snapshot0, &tc0); |
|
|
|
fpga_if_spi_read_data_02(camera_sync_timecode_snapshot1, &tc1); |
|
|
|
fpga_if_spi_read_data_02(camera_sync_cnt, &cnt); |
|
|
@ -146,9 +146,14 @@ static void xync_signal_report_thread(void const *argument) { |
|
|
|
timecode_parse_result_t result = parsetimecode(tc0, tc1); |
|
|
|
uint32_t dtime = dtimes(&lasttimecode, &result, &newday); |
|
|
|
lasttimecode = result; |
|
|
|
if (dtime < 5 && newday) { |
|
|
|
daycnt++; |
|
|
|
} else { // xsyncÐÞ¸ÄÁËʱ»ù |
|
|
|
|
|
|
|
ZLOGI(TAG, "timecode: %02d:%02d:%02d:%02d, frame: %d, dtime: %d", result.hour, result.minute, result.second, result.frame, cnt, dtime) |
|
|
|
|
|
|
|
if (dtime <= 2) { |
|
|
|
if (newday) { |
|
|
|
daycnt++; |
|
|
|
} |
|
|
|
} else { |
|
|
|
daycnt = 0; |
|
|
|
} |
|
|
|
|
|
|
|