A SHOT IN THE DARK: newbie hacks Teensy3.2's "Serial.clear()" 4 ProMini 2 use?

After reading “work arounds” for Serial.flush() not working as it once did, I discovered that Teensy3.2 has “Serial.clear()” Is there a chance in heck that eye {intentional spelling error used to imply that the author of this post has brightness < small appliance bulb} could hack it into submission so a ProMini could use it? From what I understand after a regular Arduino installation, Teensyduino is an add-on (extension? plug-in?) that allows my Teensy3.2 into the family. I’d like to hack it so Arduino thinks that the ProMini is actually from the Teensy blood-line. I know I’m facing an uphill battle, but maybe in 1/4 century I’ll get there if pointed in the right direction.

STANDARD DISCLAIMER: THE AUTHOR OF THIS POST IS CLUELESS REGARDING MOST THINGS AND IS PROBABLY AIMING WAY TO HIGH BY EVEN THINKING ABOUT DOING THIS IF THAT IS THE CASE, PLEASE ACCEPT THIS APOLOGY DESPITE BEING ABSOLUTELY WORTHLESS

This code will do what Serial.flush() did prior to Arduino IDE 1.0:

while(Serial.available()) {
  Serial.read();
}

OK thanks, that will be what I'll use. I guess my approach is not practical, I can accept that. The thing about not knowing, for me at least, is not knowing where the solution ranks, from very easy on up to very hard. I hoped I could import a section of the Teensy library or maybe copy file(s). Just out of curiosity at this point, is it because the size & complexity of the hack would require considerable time & skill, or is it an incompatibility with Teensy hardware that makes it a no go?

It's a somewhat advanced project but certainly you could achieve it with enough time and determination. However, I don't think your stated goal of changing the behavior of Serial.flush() is a good idea. This is part of the standard API and making a drastic change to that behavior is just asking for trouble. You would be better off to follow the example of Teensy and add a new function. The problem with this project is you will need to patch the Arduino core library of every hardware core you use and redo that patch every time you update to a new version of the hardware core (or Arduino IDE in the case of Arduino AVR Boards). Why go to all that trouble when you can just add a few simple lines of code to your sketch instead? The only reason I can think of is for the sake of learning, and that's certainly reason enough.

I certainly don't want to go through all that (stuff couldn't see before). Sizing up the obstacles ahead helps a lot, I see that this one makes more sense to go around. I'll stick with learning the lay of the land for now, those mountains aren't going anywhere! Thanks for helping me get an idea of what was involved.

You're welcome. I'm glad if I was able to be of assistance.
Per