-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event::clear_user() not declared static #106
Comments
Also the README lists some pinswaps that don't exist on the megaAVR 0-series (or at all): PF7 is the UPDI pin. It cannot be reconfigured to act as a GPIO pin on the megaAVR 0-series, AVR DA-series, or AVR DB-series (though in the AVR DD-series, PF7 can be set as GPIO; it gets un-GPIOified with an HV pulse... on the RESET pin (as opposed to the tinyAVR 0/1-series where that HV pulse goes to RESET/UPDI). Hence, it also shouldn't be there for MegaCoreX. |
Thanks, it is supposed to be static. Fixed!
There is no reference to |
Maybe we could use: // Helper macros to prevent us from having to check for every possible target
// megaAVR-0
#if defined(__AVR_ATmega4809__) || defined(__AVR_ATmega4808__) \
|| defined(__AVR_ATmega3209__) || defined(__AVR_ATmega3208__) \
|| defined(__AVR_ATmega1609__) || defined(__AVR_ATmega1608__) \
|| defined(__AVR_ATmega809__) || defined(__AVR_ATmega808__)
#define MEGAAVR_0
#endif
#if defined(__AVR_ATmega4809__) || defined(__AVR_ATmega3209__) \
|| defined(__AVR_ATmega1609__) || defined(__AVR_ATmega809__)
#define MEGAAVR_0_48_PIN
#elif defined(__AVR_ATmega4808__) || defined(__AVR_ATmega3208__) \
|| defined(__AVR_ATmega1608__) || defined(__AVR_ATmega808__)
#define MEGAAVR_0_32_28_PIN
#endif
// AVR-DA
#if defined(__AVR_AVR128DA64__) || defined(__AVR_AVR128DA48__) \
|| defined(__AVR_AVR128DA32__) || defined(__AVR_AVR128DA28__) \
|| defined(__AVR_AVR64DA64__) || defined(__AVR_AVR64DA48__) \
|| defined(__AVR_AVR64DA32__) || defined(__AVR_AVR64DA28__) \
|| defined(__AVR_AVR32DA48__) || defined(__AVR_AVR32DA32__) \
|| defined(__AVR_AVR32DA28__)
#define AVR_DA
#endif
#if defined(__AVR_AVR128DA64__) || defined(__AVR_AVR64DA64__)
#define AVR_DA_64_PIN
#elif defined(__AVR_AVR128DA48__) || defined(__AVR_AVR64DA48__) \
|| defined(__AVR_AVR32DA48__)
#define AVR_DA_48_PIN
#elif defined(__AVR_AVR128DA32__) || defined(__AVR_AVR64DA32__) \
|| defined(__AVR_AVR32DA32__)
#define AVR_DA_32_PIN
#elif defined(__AVR_AVR128DA28__) || defined(__AVR_AVR64DA28__) \
|| defined(__AVR_AVR32DA28__)
#define AVR_DA_28_PIN
#endif
// AVR-DB
#if defined(__AVR_AVR128DB64__) || defined(__AVR_AVR128DB48__) \
|| defined(__AVR_AVR128DB32__) || defined(__AVR_AVR128DB28__) \
|| defined(__AVR_AVR64DB64__) || defined(__AVR_AVR64DB48__) \
|| defined(__AVR_AVR64DB32__) || defined(__AVR_AVR64DB28__) \
|| defined(__AVR_AVR32DB48__) || defined(__AVR_AVR32DB32__) \
|| defined(__AVR_AVR32DB28__)
#define AVR_DB
#endif
#if defined(__AVR_AVR128DB64__) || defined(__AVR_AVR64DB64__)
#define AVR_DB_64_PIN
#elif defined(__AVR_AVR128DB48__) || defined(__AVR_AVR64DB48__) \
|| defined(__AVR_AVR32DB48__)
#define AVR_DB_48_PIN
#elif defined(__AVR_AVR128DB32__) || defined(__AVR_AVR64DB32__) \
|| defined(__AVR_AVR32DB32__)
#define AVR_DB_32_PIN
#elif defined(__AVR_AVR128DB28__) || defined(__AVR_AVR64DB28__) \
|| defined(__AVR_AVR32DB28__)
#define AVR_DB_28_PIN
#endif to mask out different features only present on a specific chip? I'll suggest we first start with the enums in Event.h to remove pins and other features not present. Agree? |
There's gotta be something we can use from the io header file? (like how in soft_event() I check the existence of registers) - cleaner code, and better odds that future chips will sort part of their functionality out on their own. |
Eg, for the event system users... there are EVSYS_USER(name of event user) #defines! That said - I wasn't demanding blocking out the ones that don't exist on a specific chip (though long term we probably should), just that like, the 0-series list and readme probably shouldn't have users listed that no part in the product line has available. |
That's a better idea. I'll have to get my daughter from kindergarten now, and I won't be available until another two hours. However, if you're available a little later, I'd like to continue working on this with you! |
Aaha! They're not in the readme - or they weren't at least until I was regenerating pieces of the table for DxCore with incautious regexes... Oh..... I see... I got tripped up by not noticing what was in which #define |
You know what's really annoying? How you can;t check for enum members with #ifdef I actually also just realized... that it's going to be a part of DxCore...
As well as defines of the form:
Does your MegaCoreX not do something similar? |
Does EVSYS override PORTx.DIR - or is it the responsibility of the user to ensure (one of my favorite phrases) that the pin is set as an output? If it is, it would be sporting to let them know in the readme. But what brought that to my mind is that... why not just #include pin_arduino and check for PIN_Pxn which is defined for all pins that exist... (at least for DxCore - and yours if you have these defines, which IMO you ought to). Oh, also, on the AVR DA parts, there's apparently one extra generator which they removed from the headers... |
Yes, MegaCoreX does. I've just pushed a fix. BTW can you fill in what peripherals are available for the DA's and DB's under the user enum here: https://github.com/MCUdude/MegaCoreX/blob/master/megaavr/libraries/Event/src/Event.h#L372-L529 ?
The pin gets automatically set to an output. At least, the output pin can both sink and source current, so I'm pretty sure the EVSYS takes care of setting the output register. Instead of checking every pin, you can see my latest commit on how I solved it. I just used your pre-defined macros to determine what target we're working with. |
Yup working on it Also... GAAAAAA THEY KNEW! THEY KNEW WHEN NUMBERING GENERATORS ON THE 4809
THAT THEY WERE GOING TO MAKE AN OVF ONE TOO! |
Awesome! I'll just copy yours when it's ready.
I wonder if OVF is supported/working on the megaAVR-0, but just left it out because of errata or similar? I wouldn't be surprised. |
Looks like it's supposed to be declared static (per readme)... but it's not, what readme suggests doesn't work:
C:\Users\Spence\Documents\Arduino\sketch_jan20a\sketch_jan20a.ino: In function 'void setup()':
sketch_jan20a:6:36: error: cannot call member function 'void Event::clear_user(user::user_t)' without object
Event::clear_user(user::tcb0_capt);
^
Also not all Dx-series devices have more than 8 channels, so I changed the soft_event() method to
The text was updated successfully, but these errors were encountered: