添加 HARD_VERSION 宏,根据硬件版本不同来确定power参数
This commit is contained in:
@@ -8,6 +8,8 @@ volatile uint16_t ad0_adc_sample[AD_SCAN_SAMPLE*AD_SCAN_COUNT];
|
||||
#define ADC1_SAMPLE_BUF_LEN 200
|
||||
#define ADC1_SAMPLE_BUF_LEN2 20
|
||||
|
||||
|
||||
|
||||
volatile uint16_t FireBus_ADC_Buf[FIREBUS_ADC_BUF_LEN];
|
||||
|
||||
|
||||
@@ -499,7 +501,7 @@ void AD_SampleResistor(uint16_t* channels_re)
|
||||
uint16_t aus_sample[32];
|
||||
uint8_t uc_index = 0;
|
||||
const static float resistor_cur = 2.49f;
|
||||
const static float res_mutli = 79.7;
|
||||
const static float res_mutli = RES_MULTIPLE;
|
||||
/*
|
||||
Gpio_ResistorSwitch
|
||||
@param 0 全关
|
||||
|
@@ -12,6 +12,7 @@ static volatile float f_cur_b;
|
||||
static volatile uint8_t uc_power_cal_flag = 0;
|
||||
volatile PowerInfo_st powerinfo_arrayst[POWER_SET_COUNT] ;
|
||||
|
||||
|
||||
/*
|
||||
@brief 获取内部基准1.2V电压对应的AD
|
||||
*/
|
||||
@@ -77,7 +78,7 @@ uint32_t Power_GetHPowerV()
|
||||
Bubble_Sort_u16(adv_buf,10);
|
||||
adv = (adv_buf[4]+adv_buf[5]+adv_buf[6]+adv_buf[7])>>2;
|
||||
adv = Power_ADVGetCalVal_106(adv);
|
||||
adv = adv*11/100000;
|
||||
adv = adv*V_PARAM_1/100000;
|
||||
return adv;
|
||||
}
|
||||
|
||||
@@ -128,7 +129,7 @@ uint32_t Power_GetMPowerV()
|
||||
Bubble_Sort_u16(adv_buf,10);
|
||||
adv = (adv_buf[4]+adv_buf[5]+adv_buf[6]+adv_buf[7])>>2;
|
||||
adv = Power_ADVGetCalVal_106(adv);
|
||||
adv = adv*11/100000;
|
||||
adv = adv*V_PARAM_1/100000;
|
||||
return adv;
|
||||
}
|
||||
|
||||
@@ -340,7 +341,7 @@ void PowerCalibration(PowerInfo_st* info_st)
|
||||
vlp = info_st->V_LAH;
|
||||
vlp /= 10;
|
||||
//(VLP-1.229V)/178K + (VDAC-1.229V)/20K = 0.1229mA
|
||||
v_adc_h =( 0.1229- (vlp-1.229)/178)*20+1.229;
|
||||
v_adc_h =( 0.1229- (vlp-1.229)/V_PARAM_2)*20+1.229;
|
||||
us_timeout = 80;
|
||||
info_st->V_LAH_DAC = 0;
|
||||
us_basedac_h = (uint16_t)( v_adc_h/3.3 * 4096);
|
||||
|
Reference in New Issue
Block a user