Using a SAMD51 Grand Central chipset and trying to determine how best to send a serial command over Serial1 such that it is done effectively in real time. Or rather, have the Arduino always able to pass along the message and get a response back at least as the Serial1 here is going to RS485 which is then going to an outside set of devices, which if sent the right ID as part of the command being sent will respond to the single Arduino that is sending.
The point, I think, is to be able to use Serial Monitor to be able to send commands to multiple devices downstream (through RS485) and have it be able to do so just about anywhere in the code that the current Arduino is running. Even if it is at a wait or if block or so on as right now that disables it from being able to send any serial data out and therefore get a response back as the only way messages are sent here is either TX commands are sent out by the sketch directly or they are sent out manually through the serial monitor. Downstream RS485 devices are only able to respond over RS485 with a single RX command to that initial TX, assuming that the ID number in the message lines up with that specific device number. So messages sent do ID 1 are only responded to by that single device and ID 2 would only be responded to by the device with ID 2 and so on.
I think that we currently have the RX set as a real time item then since that could come in at any time but the current method of using Serial.read means that anytime something on the main Arduino is in a while loop or anything else, it effectively turns off the serial monitor completely and nothing you send into it is actually sent! It actually winds up freezing the main Arduino program after 3 times (including no longer updating the serial monitor), requiring you to move the USB cable out in order to shut the software down without force closing it. At least the main Arduino hardware sketch keeps running.
Anyway, this is the code currently being used and it very much seems like the wrong approach here given what is trying to be done. Can someone please point me in the right direction for how to approach this such that the 120 MHz SAMD51 Arduino can send and receive UART serial commands through, well, the PC serial monitor in the Arduino software which will be passed on to RS485 and then listened to by other upstream hardware which will send back a RX command to the Arduino if it is the correct serial ID in the command is being sent.
if(Serial.available()){
comm.consoleComm(Serial.read());
}
From what I am starting to understand a bit better, ISR doesn't sound quite like the typical (or correct) approach here exactly and the idea here is not to use ISR to send serial commands exactly anyway since that's not how it is meant to work but the entire point of this is to have some kind of conduit to be able to real time send and receive serial commands through the serial monitor irrespective of what the main sketch is doing. Still learning here and reading a fair bit but both ARM and these various levels of interrupts are both much more flexible but also much more complicated as well!

