From ed9e7ea424da5d4a12fd09fb740367e47ff94afa Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:43:15 +0800 Subject: [PATCH] check unsafe tab value --- src/hardware.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hardware.c b/src/hardware.c index c8efcc2..5a1fb07 100644 --- a/src/hardware.c +++ b/src/hardware.c @@ -413,6 +413,10 @@ void GetVtxParameter() { tab_min[j] = tab[i][j]; if (tab[i][j] == 0xFF) ee_vld = 0; + else if (tab[i][j] < 0x40 || tab[i][j] > 0xa0) { + tab[i][j] = table_power[i][j]; + I2C_Write8_Wait(10, ADDR_EEPROM, i * (POWER_MAX + 1) + j, tab[i][j]); + } } }