Skip to content

Commit

Permalink
reset config via define RESET_CONFIG (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
ligenxxxx authored Mar 25, 2024
1 parent 0258086 commit 5d03f35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
// #define REV_UART
// #define VIDEO_PAT
// #define FIX_EEP
// #define RESET_CONFIG

#ifndef _RF_CALIB
// #define _DEBUG_MODE
Expand Down
12 changes: 8 additions & 4 deletions src/hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ uint8_t timer_cnt = 0;
uint8_t led_timer_cnt = 0;

void LED_Init();
#if (0)
uint8_t check_uart_loopback();
#endif
void reset_config();

void Set_720P50(uint8_t page) {
Expand Down Expand Up @@ -559,8 +561,9 @@ void Init_HW() {
LED_TC3587_Init();
#endif

if (check_uart_loopback())
reset_config();
#ifdef RESET_CONFIG
reset_config();
#endif

GetVtxParameter();
Get_EEP_LifeTime();
Expand Down Expand Up @@ -1740,7 +1743,7 @@ void reset_config() {

I2C_Write8_Wait(10, ADDR_EEPROM, EEP_ADDR_CAM_TYPE, 0);
}

#if (0)
uint8_t check_uart_loopback() {
uint8_t rdat[4];
uint8_t i = 0;
Expand All @@ -1764,4 +1767,5 @@ uint8_t check_uart_loopback() {
} else {
return 0;
}
}
}
#endif

0 comments on commit 5d03f35

Please sign in to comment.