diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 15eed77..908a118 100644 --- a/usrc/project_configs.h +++ b/usrc/project_configs.h @@ -1,7 +1,7 @@ #pragma once #define VERSION(main, sub, fix) (main << 16 | sub << 8 | fix << 0) -#define PC_VERSION VERSION(3, 1, 0) +#define PC_VERSION VERSION(3, 2, 0) #define PC_MANUFACTURER0 ('i' | 'f' << 8 | 'l' << 16 | 'y' << 24) #define PC_MANUFACTURER1 ('t' | 'o' << 8 | 'p' << 16 | '\0' << 24) diff --git a/usrc/service/report_generator_service.c b/usrc/service/report_generator_service.c index 32c8790..48ce001 100644 --- a/usrc/service/report_generator_service.c +++ b/usrc/service/report_generator_service.c @@ -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; }