From 5e3147bb179b60a3a48b3611347e359dcb8e46e9 Mon Sep 17 00:00:00 2001 From: Spence Konde Date: Fri, 5 Apr 2024 18:58:56 -0400 Subject: [PATCH] Update Arduino.h And for 0/1-series --- megaavr/cores/megatinycore/Arduino.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/megaavr/cores/megatinycore/Arduino.h b/megaavr/cores/megatinycore/Arduino.h index b2b6492e..3421c0c2 100644 --- a/megaavr/cores/megatinycore/Arduino.h +++ b/megaavr/cores/megatinycore/Arduino.h @@ -96,6 +96,10 @@ #if MEGATINYCORE_SERIES < 2 /* ADC constants for 0/1-series */ + #define _ADC_ENABLE_VAL 0x10 + #define _ADC_ENABLE_CTRL 0x20 + #define _ADC_STANDBY_VAL 0X40 + #define _ADC_STANDBY_CTRL 0x80 #define LOW_LAT_ON badArg("This option is on 2-series tiny and AVR Ex-series only") #define LOW_LAT_OFF badArg("This option is on 2-series tiny and AVR Ex-series only") #define ADC_LOWLAT_ON badArg("This option is on 2-series tiny and AVR Ex-series only") @@ -103,10 +107,10 @@ #define PGA_KEEP_ON badArg("This option is on 2-series tiny and AVR Ex-series only") #define PGA_AUTO_OFF badArg("This option is on 2-series tiny and AVR Ex-series only") #define PGA_OFF_ONCE badArg("This option is on 2-series tiny and AVR Ex-series only") - #define ADC_ENABLE 0x20 - #define ADC_DISABLE 0x30 - #define ADC_STANDBY_ON 0xC0 - #define ADC_STANDBY_OFF 0x80 + #define ADC_ENABLE _ADC_ENABLE_CTRL | _ADC_ENABLE_VAL + #define ADC_DISABLE _ADC_ENABLE_CTRL + #define ADC_STANDBY_ON _ADC_STANDBY_CTRL | _ADC_STANDBY_VAL + #define ADC_STANDBY_OFF _ADC_STANDBY_CTRL #define INTERNAL0V55 (VREF_ADC0REFSEL_0V55_gc >> VREF_ADC0REFSEL_gp) #define INTERNAL1V1 (VREF_ADC0REFSEL_1V1_gc >> VREF_ADC0REFSEL_gp) #define INTERNAL2V5 (VREF_ADC0REFSEL_2V5_gc >> VREF_ADC0REFSEL_gp)