SpenceKonde / megaTinyCore

Arduino core for the tinyAVR 0/1/2-series - Ones's digit 2,4,5,7 (pincount, 8,14,20,24), tens digit 0, 1, or 2 (featureset), preceded by flash in kb. Library maintainers: porting help available!
Other
544 stars 141 forks source link

getAnalogReadResolution() not present in megaTinyCore #1006

Closed SpenceKonde closed 9 months ago

SpenceKonde commented 9 months ago

Discussed in https://github.com/SpenceKonde/megaTinyCore/discussions/1004

Originally posted by **Warren52** September 19, 2023 So I am taking analog readings from a 10K Pot with one end tied through a 1K resistor to 5VDC and the other end to Ground. I am putting code together that I want to work on both an AVR128DB28 (using DxCore) and an ATtiny 3224 (using metaTinyCore). I just finished getting the DxCore code working nicely and moved it to my ATtiny 3224 / megaTinyCore setup and have hit a snag. With the DxCore I have a working getAnalogResolution() function but the compile on megaTinyCore reports: undefined reference to `getAnalogReadResolution' Your megaTinyCore https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/Ref_Analog.md document includes documentation for the getAnalogReferece() function and I have searched both DxCore and megaTinyCore code finding BOTH have the function definition in their respective Arduino.h files but there is no body to be found in megaTinyCore. My code isn't really rocket science: if(getAnalogResolution() != 12) analogReadResolution(12). So: - Is this just an oversight and the body will eventually be added to megaTinyCore or are there some other plans? - If there are other plans, what common code should be used to perform getAnalogResolution() for DxCore and megaTinyCore?
SpenceKonde commented 9 months ago

Neither of the above,