Closed drbeefsupreme closed 3 years ago
I see you have already implemented something. If your solution works, could you submit a pull request?
I forked the repo and tried my first dumb idea, but it didn't work. Didn't get a chance to work on it yesterday. I ought to have time some night this week though. I don't really follow GitHub etiquette for my personal forks, so the fact that I merged a PR on my fork just means I was being lazy with the device I was pushing the repo to - I didn't want to modify my platformio file to work with a branch other than master.
I didn't see any obvious mistakes, except perhaps for a missing prototype in io.h
. You might want to add the following line.
void begin(usb_serial_class&);
Could you try the last version on the master branch?
We just merged some code that introduces a Stream
class for issue #8, can you try pulling from master
and see if it works? The syntax would be HardwareSerialIO::begin(&usb_serial_class)
Thanks, I will try this out tonight with my Teensy 3.6 and report back.
It works! I used SerialIO::begin
though (which I think is what you meant?). Thank you very much.
Nice.
Is your feature request related to a problem? Please describe. I want to use simpleRPC with a Teensy 3.6. I tried to run
HardwareSerialIO::begin
with theSerial
object but the compiler tells meerror: no matching function for call to 'HardwareSerialIO::begin(usb_serial_class&)
Describe the solution you'd like I think a new plugin that works with
usb_serial_class
, or possibly overloadingHardwareSerialIO::begin
to work with it.Alternative solution They both inherit from
Stream
so maybe just haveHardwareSerialIO::begin
take in aStream
? This might cause other issues if used improperly though, I don't know what else aStream
might be.Additional context I figured out that this is because the Teensy treats the USB serial port separately from the I/O pin serial ports, unlike most ordinary Arduinos which link the USB TX and RX with the serial TX and RX via a resistor and thus
HardwareSerial
covers both. So with the Teensy they are treated with a separate class, but are still hardware serial ports (at least for the Teensy 3.6, I haven't looked at other ones yet).I am pretty new to the Teensy/Arduino world, not to mention C++, but this seems like an easy problem that only needs a few lines of code to fix. I will give it the old college try tomorrow.