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
554 stars 144 forks source link

Update dirty_tricks.h #954

Closed MX682X closed 1 year ago

MX682X commented 1 year ago

Ok so, there may or may not have been a case where I accidentely used a wrong pointer for this macro.... so I thought, it would be a good idea to make it less dirty... badArg wasn't shown on my end if I supplied a wrong type, but it still didn't let me compile and I think it's always better to have some save guard. Better save then sorry, y'know?

SpenceKonde commented 1 year ago

Cool - that checking is all compiletime right? Merging. We're getting mad failures right now but that's because I don't know github yaml well enough to fix it. I may just rename the internal name of some options on the 2-series have to reference the mux of a non-existant TCD (in the name - not any of the compile flags that come with it or anything, but otherwise I need to figure out how to give different names to the 0, 1 and 2 series PWMmap options when running the test

MX682X commented 1 year ago

C can't check the type of variables at runtime, so yes, all compiletime