Skip to content

Commit 05eba3d

Browse files
Roy, ElizabethRoy, Elizabeth
Roy, Elizabeth
authored and
Roy, Elizabeth
committed
Changed VCC_5V to VCC_5V0 + fixed some indentation
1 parent 09b2299 commit 05eba3d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cores/arduino/Arduino.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extern "C"{
5656
#define VDD ADC_REFSEL_VDDREF_gc
5757
#define EXTERNAL ADC_REFSEL_VREFA_gc
5858

59-
#define VCC_5V 2
59+
#define VCC_5V0 2
6060
#define VCC_3V3 1
6161
#define VCC_1V8 0
6262

cores/arduino/wiring.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ void init()
314314

315315
/* Only for the purposes of staying within safe operating range -- approximate */
316316
if(voltage >= 48){ /* 4.8V+ -> 5V */
317-
supply_voltage = VCC_5V;
317+
supply_voltage = VCC_5V0;
318318
} else if (voltage >= 30){ /* 3V-4V7 -> 3V3 */
319319
supply_voltage = VCC_3V3;
320320
} else { /* < 3V -> 1V8 */
@@ -346,7 +346,7 @@ void init()
346346

347347
/* Initialize clock divider to stay within safe operating area */
348348

349-
if(supply_voltage >= VCC_5V){
349+
if(supply_voltage >= VCC_5V0){
350350

351351
/* Disable system clock prescaler - F_CPU should now be ~16/20MHz */
352352
_PROTECTED_WRITE(CLKCTRL_MCLKCTRLB, 0x00);
@@ -368,7 +368,7 @@ void init()
368368

369369
}
370370

371-
} else if (supply_voltage == VCC_3V3) {
371+
} else if (supply_voltage == VCC_3V3) {
372372

373373
/* Enable system clock prescaler to DIV2 - F_CPU should now be ~8/10MHz */
374374
_PROTECTED_WRITE(CLKCTRL_MCLKCTRLB, (CLKCTRL_PEN_bm | CLKCTRL_PDIV_2X_gc));
@@ -389,7 +389,7 @@ void init()
389389
#endif
390390
}
391391

392-
} else {
392+
} else {
393393
/* Shouldn't get here but just in case... */
394394

395395
/* Enable system clock prescaler to DIV4 - F_CPU should now be ~4/5MHz */

0 commit comments

Comments
 (0)