Closed mcpat-it closed 7 months ago
You should raise this issue with the author of the library, he is the one who has written a "arduino" library which tries to reuse a name used by the stock core and portions of the API thhat would break tons of code if changed. u We can't change that "DEFAULT" define without breaking compatibility with countless existing arduino sketches, because DEFAULT is part of the API (namely, it's the define that you pass to analogReference() to set to the default I belive). If I had designed Arduino I would have prefixed or postfixed that with someting. But Arduino didn't do that, and I can't come up with any explanation that doesn't reflect poorly on them. So there are stupid named defines like DEFAULT and BUFFER_SIZE (default what? Well ADC reference.Size of what buffer? The I2C buffer of course). I routinely get requests to change these stupid names, but the fact is that doing so breaks compatibility. Library authors have a responsibility to not use macro names used in stock arduino!
Arduino in their infinitesimal *
wisdom, chose to declare that DEFAULT is the define for the default (VDD) adc reference. An Arduino library that is in conflict with that is hard to call an Arduino library.
*
- Infinitesimal = infinitely small, opposite of infinite. Can you tell i'm less than impressed with their design decisions?
@SpenceKonde fully agree with you! Will contact the supplier if he is willing to correct. I wrote my own code which is doing more or less the same but without conflicts. Thx for answering!
I try to compile for a attiny817 (with SparkFun_STUSB4500) and get this warning, it disappears when I change DEFAULT to DEFAULT1 or something else (in file
stusb4500_register_map.h
), but don't know what will happen (I ordered the board "SparkFun Power Delivery Board - USB-C (Qwiic)", but will receive it in a couple of days, so I want to know it in advance):