zhaohe 1 year ago
parent
commit
ab7f05df52
  1. 2
      usrc/project_configs.h
  2. 15
      usrc/service/report_generator_service.c

2
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)

15
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;
}

Loading…
Cancel
Save