ADC增益开启与关闭点改为宏定义,开启改为190,关闭改为1900

This commit is contained in:
95384 2025-03-01 09:52:22 +08:00
parent 798a442abe
commit bb2c0d034e
2 changed files with 10 additions and 8 deletions

View File

@ -20,6 +20,8 @@
#define ADC_GAIN_ENABLE 190
#define ADC_GAIN_DISABLE 1900
#define K_128 0xA12EE1FE #define K_128 0xA12EE1FE
// 延时REV_MUTE_DELAY us启动ADC采集数据 // 延时REV_MUTE_DELAY us启动ADC采集数据

View File

@ -93,30 +93,30 @@ void config_adc_gain(uint8_t channel, uint16_t max_val)
switch(channel) switch(channel)
{ {
case 0x01: case 0x01:
if(max_val <= 180) if(max_val <= ADC_GAIN_ENABLE)
gain_status.gain_status_s = 1; gain_status.gain_status_s = 1;
else if(max_val >= 1900) else if(max_val >= ADC_GAIN_DISABLE)
gain_status.gain_status_s = 0; gain_status.gain_status_s = 0;
break; break;
case 0x02: case 0x02:
if(max_val <= 180) if(max_val <= ADC_GAIN_ENABLE)
gain_status.gain_status_n = 1; gain_status.gain_status_n = 1;
else if(max_val >= 1900) else if(max_val >= ADC_GAIN_DISABLE)
gain_status.gain_status_n = 0; gain_status.gain_status_n = 0;
break; break;
case 0x03: case 0x03:
if(max_val <= 180) if(max_val <= ADC_GAIN_ENABLE)
gain_status.gain_status_e = 1; gain_status.gain_status_e = 1;
else if(max_val >= 1900) else if(max_val >= ADC_GAIN_DISABLE)
gain_status.gain_status_e = 0; gain_status.gain_status_e = 0;
break; break;
case 0x04: case 0x04:
if(max_val <= 180) if(max_val <= ADC_GAIN_ENABLE)
gain_status.gain_status_w = 1; gain_status.gain_status_w = 1;
else if(max_val >= 1900) else if(max_val >= ADC_GAIN_DISABLE)
gain_status.gain_status_w = 0; gain_status.gain_status_w = 0;
break; break;