Like what was added for T3.x with that 3 yeard PR, I added the same support to T4.x
Added the PORT TOGGLE defines. I copied the _PORTSET blocks and then simply used block editing in Sublime text to then change the SET to Toggle.
Also added in the code...
Test sketch:
```
void setup() {
pinMode(13, OUTPUT);
}
int led = 13;
void loop() {
digitalToggleFast(led);
delay(500);
digitalToggleFast(13);
delay(250);
digitalToggle(13);
delay(1000);
digitalToggle(led);
delay(250);
}
```
Also added values to keywords.txt
I forgot to remove the default eventhandlers from some of the HardwareSerial files as such the ones in the serialEventX files was not used and why my flags were not set properly.
Could have done simple fix, but decide to make it more consistent with what I did in T3.x/LC code and not look through all the NULLS, but simply have list of active ones and count of active.
Appears to fix the issue so far.
Code is setup that if there are no eventResponders that have registered to do interrupt calls, don't have the systic code in place to look for it.
Also yield code. Now figures out if the user has any code that installs their own serialEventX methods, to call them, but if they have left the default weak pointer versions, to not call them in yield. Likewise will only look for eventRespnder events if the sketch has actually attached any events. If none of these conditions are true, yield will just check one flag and return.
T3.x Serial events cleanup
Found a way that appears to work to detect if a sketch has our default serialEvantX functions, and that the users code has not implemented their own. Before on SerialX.begin() I would add that serial ports code to table of function calls to do the if SerialX.available() call serialEvernt..
But I now have a hacked up version where each of the event functions are in their own source file, along with a variable that is defined. Elsewhere I have those same variables defined with an attribute of ((weak)), so if our default implemention is pulled in it is defined with a value of 1, if the weak version is used because the user has their own implemention, then it is defined as a 0... So I can detect this at the begin method and only add the code to do the checks in yield if the user implemented it.
WARNING this also brought in changes for using XBar pins for CTS and RX pins... As I did not wish to split back out and have you maybe have to manually merge.