修复AD问题
This commit is contained in:
parent
ed84735e60
commit
e33e8d8aab
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"rte.h": "c",
|
"rte.h": "c",
|
||||||
"sysdiagdetect.h": "c"
|
"sysdiagdetect.h": "c",
|
||||||
|
"osekcom.h": "c"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -22,10 +22,12 @@ void FunctionState_Task(void)
|
|||||||
if (adcResetFlag == 0)
|
if (adcResetFlag == 0)
|
||||||
{
|
{
|
||||||
ADC1_Initialize();
|
ADC1_Initialize();
|
||||||
|
ADC1_Enable();
|
||||||
|
ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
|
||||||
|
ADC1_ConversionStart();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LD_AD_Val = adc[1];
|
LD_AD_Val = adc[1];
|
||||||
|
|
||||||
switch(Fuction_State)
|
switch(Fuction_State)
|
||||||
|
@ -1433,6 +1433,7 @@ void RTE_Set_All_Test_Value(void)
|
|||||||
{
|
{
|
||||||
baseline_error_repeat_counter = 55000;//110S
|
baseline_error_repeat_counter = 55000;//110S
|
||||||
ADC0_Initialize();
|
ADC0_Initialize();
|
||||||
|
ADC0_Enable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -96,10 +96,12 @@ void ADC1_ConversionCallback (ADC_STATUS status, uintptr_t context)
|
|||||||
case ADC1_CH_AD_LDO_SNS:
|
case ADC1_CH_AD_LDO_SNS:
|
||||||
ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
|
ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
|
||||||
adc_ch_sel= ADC1_CH_LD_OUT_SNS;
|
adc_ch_sel= ADC1_CH_LD_OUT_SNS;
|
||||||
|
ADC1_ConversionStart();
|
||||||
break;
|
break;
|
||||||
case ADC1_CH_LD_OUT_SNS:
|
case ADC1_CH_LD_OUT_SNS:
|
||||||
ADC1_ChannelSelect(ADC_POSINPUT_AIN7, ADC_NEGINPUT_GND);
|
ADC1_ChannelSelect(ADC_POSINPUT_AIN7, ADC_NEGINPUT_GND);
|
||||||
adc_ch_sel= ADC1_CH_AD_LDO_SNS;
|
adc_ch_sel= ADC1_CH_AD_LDO_SNS;
|
||||||
|
ADC1_Disable();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -108,7 +110,7 @@ void ADC1_ConversionCallback (ADC_STATUS status, uintptr_t context)
|
|||||||
//if (adc_ch_sel > ADC1_CH_MAX) {
|
//if (adc_ch_sel > ADC1_CH_MAX) {
|
||||||
// adc_ch_sel = ADC1_CH_AD_LDO_SNS + 1;
|
// adc_ch_sel = ADC1_CH_AD_LDO_SNS + 1;
|
||||||
//}
|
//}
|
||||||
ADC1_ConversionStart();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,9 +273,9 @@ int main ( void )
|
|||||||
{
|
{
|
||||||
/* Maintain state machines of all polled MPLAB Harmony modules. */
|
/* Maintain state machines of all polled MPLAB Harmony modules. */
|
||||||
SYS_Tasks ( );
|
SYS_Tasks ( );
|
||||||
ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
|
//ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
|
||||||
|
|
||||||
ADC1_ConversionStart();
|
//ADC1_ConversionStart();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user