From ac03ee76e532552405018aa9e439b19a3ebd09f6 Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:15:22 +0800 Subject: [PATCH 1/2] calib L2 with camera --- src/camera.c | 1 + src/common.h | 4 ++-- src/hardware.c | 6 ++++++ src/mcu.c | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/camera.c b/src/camera.c index adb6909..a21fd09 100644 --- a/src/camera.c +++ b/src/camera.c @@ -232,6 +232,7 @@ void camera_mode_detect(uint8_t init) { if (cycles == 0) { Set_720P60(0); + WriteReg(0, 0x50, 0x01); video_format = VDO_FMT_720P60; I2C_Write16(ADDR_TC3587, 0x0058, 0x00e0); camera_type = CAMERA_TYPE_RESERVED; diff --git a/src/common.h b/src/common.h index ce7bb7e..30438aa 100644 --- a/src/common.h +++ b/src/common.h @@ -77,8 +77,8 @@ // #define EXTEND_BUF1 // mode -// #define _RF_CALIB -// #define REV_UART +#define _RF_CALIB +#define REV_UART // #define VIDEO_PAT // #define FIX_EEP // #define RESET_CONFIG diff --git a/src/hardware.c b/src/hardware.c index ad0c00e..77b79e6 100644 --- a/src/hardware.c +++ b/src/hardware.c @@ -518,6 +518,12 @@ void Init_HW() { GetVtxParameter(); Get_EEP_LifeTime(); camera_init(); +#ifdef _RF_CALIB + RF_POWER = 0; // max power + RF_FREQ = 0; // ch1 + Init_6300RF(RF_FREQ, RF_POWER); + DM6300_AUXADC_Calib(); +#endif //--------- dm6300 -------------------- // move to RF_Delay_Init() #endif diff --git a/src/mcu.c b/src/mcu.c index 5f44bce..43cdf6c 100644 --- a/src/mcu.c +++ b/src/mcu.c @@ -190,7 +190,9 @@ void main(void) { uart_baudrate_detect(); runcam_shutter_fix(seconds); } +#ifndef _RF_CALIB RF_Delay_Init(); +#endif #ifdef USE_USB_DET usb_det_task(); From 79fb24ad411207004e706302ece945c5d6bb742f Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:36:33 +0800 Subject: [PATCH 2/2] fix race3 calib --- src/tramp_protocol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tramp_protocol.c b/src/tramp_protocol.c index 9f9068e..d7de707 100644 --- a/src/tramp_protocol.c +++ b/src/tramp_protocol.c @@ -247,6 +247,7 @@ void tramp_receive(void) { } void tramp_init(void) { +#ifndef _RF_CALIB uint16_t time_ms = 3000; RF_POWER = POWER_MAX + 2; while (time_ms--) { @@ -255,5 +256,6 @@ void tramp_init(void) { } if (!tramp_lock) RF_POWER = I2C_Read8(ADDR_EEPROM, EEP_ADDR_RF_POWER); +#endif } #endif \ No newline at end of file