Skip to content

Commit

Permalink
Merge pull request #435 from arduino/aref-unused-c33
Browse files Browse the repository at this point in the history
analog: declare aref variable only if used
  • Loading branch information
pennam authored Feb 18, 2025
2 parents c7e6f55 + 47982f8 commit e7ed91b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cores/arduino/analog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,10 @@ void analogReference(uint8_t mode) {
R_ADC_Open(&adc1.ctrl, &adc1.cfg);
}

#if defined(AVCC_MEASURE_PIN)
static float aref = 0;
#endif

float analogReference() {
switch (adc.cfg_extend.adc_vref_control) {
case ADC_VREF_CONTROL_1_5V_OUTPUT:
Expand Down Expand Up @@ -817,4 +820,4 @@ void analogWrite(pin_size_t pinNumber, int value)

FspTimer* __get_timer_for_channel(int channel) {
return pwms.get_from_channel(channel)->get_timer();
}
}

0 comments on commit e7ed91b

Please sign in to comment.