defragster
Senior Member+
Moved to Serial1 for debug_tt rather than out Serial and it is showing ... three blinking T_4.0's on my desk.
Opps - wondered why USB hub lights were blinking ... 5V pin of a T4 was hitting the USB hood of another ... back to blinking ... until the code hangs ...
The _isr() is no longer triggering - seems the extra USB messages were keeping it 'more' alive. <edit>: Also hang is after way fewer RawHID.recv message again : "R:21: V:21"
But indications are the code is not faulting. And loop() has stopped running because I have a print there after some entries - but use/print of "elapsedMicros time;" is funky - just noticed that is us not ms!
Not sure where my debug TTL to Serial sketch was so I wrote this:
Opps - wondered why USB hub lights were blinking ... 5V pin of a T4 was hitting the USB hood of another ... back to blinking ... until the code hangs ...
The _isr() is no longer triggering - seems the extra USB messages were keeping it 'more' alive. <edit>: Also hang is after way fewer RawHID.recv message again : "R:21: V:21"
But indications are the code is not faulting. And loop() has stopped running because I have a print there after some entries - but use/print of "elapsedMicros time;" is funky - just noticed that is us not ms!
Not sure where my debug TTL to Serial sketch was so I wrote this:
Code:
#define LOOP_BAUD 115200
void setup() {
Serial.begin(115200);
while (!Serial && millis() < 4000 );
pinMode( LED_BUILTIN, OUTPUT );
digitalWrite(LED_BUILTIN, 1);
Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);
Serial1.begin( LOOP_BAUD );
Serial2.begin( LOOP_BAUD );
Serial.print("\n Serial 1 or 2 USE BAUD::");
Serial.println(LOOP_BAUD);
}
char rdBuff[1025];
void loop() {
if ( Serial.available() ) {
int ii;
someBlink();
while ( (ii = Serial.available()) ) {
if ( ii > 1024 )ii = 1024;
Serial.readBytes( rdBuff, ii);
rdBuff[ii] = 0;
Serial.write( rdBuff, ii );
}
}
if ( Serial1.available() ) {
int ii;
someBlink();
while ( (ii = Serial1.available()) ) {
if ( ii > 1024 )ii = 1024;
Serial1.readBytes( rdBuff, ii);
rdBuff[ii] = 0;
Serial.write( rdBuff, ii );
}
}
if ( Serial2.available() ) {
int ii;
someBlink();
while ( (ii = Serial2.available()) ) {
if ( ii > 1024 )ii = 1024;
Serial2.readBytes( rdBuff, ii);
rdBuff[ii] = 0;
Serial.write( rdBuff, ii );
}
}
}
uint32_t LastB=0;
void someBlink() {
if ( millis() -LastB > 100) {
LastB = millis();
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}
}
Last edited: