Skip to content

Commit a1b261a

Browse files
authored
Merge pull request #226 from ligenxxxx/L2_calib_calib
fix race3 rf calib
2 parents 9b62b3d + 79fb24a commit a1b261a

5 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/camera.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ void camera_mode_detect(uint8_t init) {
232232

233233
if (cycles == 0) {
234234
Set_720P60(0);
235+
WriteReg(0, 0x50, 0x01);
235236
video_format = VDO_FMT_720P60;
236237
I2C_Write16(ADDR_TC3587, 0x0058, 0x00e0);
237238
camera_type = CAMERA_TYPE_RESERVED;

src/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@
7777
// #define EXTEND_BUF1
7878

7979
// mode
80-
// #define _RF_CALIB
81-
// #define REV_UART
80+
#define _RF_CALIB
81+
#define REV_UART
8282
// #define VIDEO_PAT
8383
// #define FIX_EEP
8484
// #define RESET_CONFIG

src/hardware.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,12 @@ void Init_HW() {
518518
GetVtxParameter();
519519
Get_EEP_LifeTime();
520520
camera_init();
521+
#ifdef _RF_CALIB
522+
RF_POWER = 0; // max power
523+
RF_FREQ = 0; // ch1
524+
Init_6300RF(RF_FREQ, RF_POWER);
525+
DM6300_AUXADC_Calib();
526+
#endif
521527
//--------- dm6300 --------------------
522528
// move to RF_Delay_Init()
523529
#endif

src/mcu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ void main(void) {
190190
uart_baudrate_detect();
191191
runcam_shutter_fix(seconds);
192192
}
193+
#ifndef _RF_CALIB
193194
RF_Delay_Init();
195+
#endif
194196

195197
#ifdef USE_USB_DET
196198
usb_det_task();

src/tramp_protocol.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ void tramp_receive(void) {
247247
}
248248

249249
void tramp_init(void) {
250+
#ifndef _RF_CALIB
250251
uint16_t time_ms = 3000;
251252
RF_POWER = POWER_MAX + 2;
252253
while (time_ms--) {
@@ -255,5 +256,6 @@ void tramp_init(void) {
255256
}
256257
if (!tramp_lock)
257258
RF_POWER = I2C_Read8(ADDR_EEPROM, EEP_ADDR_RF_POWER);
259+
#endif
258260
}
259261
#endif

0 commit comments

Comments
 (0)