Changed to using an initial value for u16.
This commit is contained in:
parent
26993753fe
commit
2be04980d1
|
@ -14,7 +14,7 @@ void Load_HandleLoadPortA(uint8_t adc_pin, uint8_t out_pin)
|
||||||
{
|
{
|
||||||
ADC_Init(adc_pin);
|
ADC_Init(adc_pin);
|
||||||
ADC_Enable(adc_pin);
|
ADC_Enable(adc_pin);
|
||||||
uint16_t val;
|
uint16_t val = 0;
|
||||||
for(int i = 0; i < 32; i++){
|
for(int i = 0; i < 32; i++){
|
||||||
val += ADC_ReadValue(adc_pin);
|
val += ADC_ReadValue(adc_pin);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ void Load_HandleLoadPortB(uint8_t adc_pin, uint8_t out_pin)
|
||||||
{
|
{
|
||||||
ADC_Init(adc_pin);
|
ADC_Init(adc_pin);
|
||||||
ADC_Enable(adc_pin);
|
ADC_Enable(adc_pin);
|
||||||
uint16_t val;
|
uint16_t val = 0;
|
||||||
for(int i = 0; i < 32; i++){
|
for(int i = 0; i < 32; i++){
|
||||||
val = ADC_ReadValue(adc_pin);
|
val = ADC_ReadValue(adc_pin);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue