Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e7ed91b

Browse files
authored
Merge pull request #435 from arduino/aref-unused-c33
analog: declare aref variable only if used
2 parents c7e6f55 + 47982f8 commit e7ed91b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎cores/arduino/analog.cpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,10 @@ void analogReference(uint8_t mode) {
558558
R_ADC_Open(&adc1.ctrl, &adc1.cfg);
559559
}
560560

561+
#if defined(AVCC_MEASURE_PIN)
561562
static float aref = 0;
563+
#endif
564+
562565
float analogReference() {
563566
switch (adc.cfg_extend.adc_vref_control) {
564567
case ADC_VREF_CONTROL_1_5V_OUTPUT:
@@ -817,4 +820,4 @@ void analogWrite(pin_size_t pinNumber, int value)
817820

818821
FspTimer* __get_timer_for_channel(int channel) {
819822
return pwms.get_from_channel(channel)->get_timer();
820-
}
823+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /