Changed to using an initial value for u16.

This commit is contained in:
jakeg00dwin 2024-07-24 17:54:11 -07:00
parent 26993753fe
commit 2be04980d1
1 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ void Load_HandleLoadPortA(uint8_t adc_pin, uint8_t out_pin)
{
ADC_Init(adc_pin);
ADC_Enable(adc_pin);
uint16_t val;
uint16_t val = 0;
for(int i = 0; i < 32; i++){
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_Enable(adc_pin);
uint16_t val;
uint16_t val = 0;
for(int i = 0; i < 32; i++){
val = ADC_ReadValue(adc_pin);
}