defragster
Senior Member+
I haven't had time to start yet - if there is a version _V5 ready to minimize DIFFS I see first I'll use that - otherwise I'll take the P# 272 changes as my start. Need to get wood for the woodstove and see what else is on my plate for the day.
With the Master connected to USB for debug the Master can use Serial for input and output at any time. Just needs a parser set up for the commands. Another nice thing about SPI_MST!
Chris O posted the CPUspecs() I wrote during K66 - I found that in about 8 Beta sketches - I had that as a parsed command to spit it out so I could ask for it at any time. I never wrote a GOOD parser - just a bunch of case statements to handle what I was doing at the time with single char commands.
This and other could be put into D_Debug.ino to keep clutter out of the core code? I'll start the Timing in T_Timing.ino perhaps?
Here is one example - when I was hitting the Serial# ports - in case it inspires a way to use it cleanly - even has help/'?' for the commands. It can call any function or change or show any Global variable? This was written when I thought serialEvent() was cool - but "void yield()" bypasses this - so explicit call to serialEvent() would need to be added to loop().
This one doesn't use '+' and '-' which could be used to adjust a variable - and what variable is adjusted could be changed with a command.
With the Master connected to USB for debug the Master can use Serial for input and output at any time. Just needs a parser set up for the commands. Another nice thing about SPI_MST!
Chris O posted the CPUspecs() I wrote during K66 - I found that in about 8 Beta sketches - I had that as a parsed command to spit it out so I could ask for it at any time. I never wrote a GOOD parser - just a bunch of case statements to handle what I was doing at the time with single char commands.
This and other could be put into D_Debug.ino to keep clutter out of the core code? I'll start the Timing in T_Timing.ino perhaps?
Here is one example - when I was hitting the Serial# ports - in case it inspires a way to use it cleanly - even has help/'?' for the commands. It can call any function or change or show any Global variable? This was written when I thought serialEvent() was cool - but "void yield()" bypasses this - so explicit call to serialEvent() would need to be added to loop().
This one doesn't use '+' and '-' which could be used to adjust a variable - and what variable is adjusted could be changed with a command.
Code:
void serialEvent() {
while (Serial.available() ) {
char inChar = (char)Serial.read();
switch ( inChar ) {
case 't':
if ( doDelay > 50 )
doDelay = 50;
else
doDelay = 2 + doDelay / 2;
Serial.print("\nTURBO ms==");
Serial.println(doDelay);
break;
case 'f':
doDelay = 700;
Serial.println("\nfast 700ms");
break;
case 's':
doDelay = 2000;
Serial.println("\nslow 2000ms");
break;
case 'o':
pinMode(5, OUTPUT);
digitalWrite(5, 0);//Disable Amplified.
Serial.println("\nAMP OFF");
break;
case 'O':
pinMode(5, OUTPUT);
digitalWrite(5, 1);//Enable Amplified.
Serial.println("\nAMP ON");
break;
case 'c':
CPUspecs(0);
break;
case 'w':
widepad += 10;
if (widepad > 240) widepad = 0;
Serial.print("\nWidePrint==");
Serial.println(widepad);
break;
case '?':
Serial.println("ENTER:: 's' slow blink, 'f' fast blink, 't' TURBO blink, 'c' CPU Specs, 'w' pad '~'");
break;
case '\n':
case '\r':
Serial.println("_");
break;
default:
Serial.print(inChar);
break;
}
}
}