bolderflight / sbus

Arduino and CMake library for communicating with SBUS receivers and servos.
MIT License
373 stars 132 forks source link

Unable to pass Sercom Serial object into SBUS RX #64

Closed BungalowBill68 closed 1 year ago

BungalowBill68 commented 1 year ago

I'm working on a project where I need to use a Sercom Serial port on a Feather M4 to decode and process a SBUS Stream. Passing the created Serial2 object into bfs::SbusRx sbus_rx(&Serial2) compiles, but does not function. I believe the issue is caused by the library expecting a hardware serial port, but the Sercom port being a different type, but I'm not sure how to approach this, and any help would be appreciated. My full code is below: sercom.txt

Thanks in advance,

flybrianfly commented 1 year ago

Because every microcontroller handles inverted serial differently, if your microcontroller isn't listed, we start the bus with non-inverted serial. You probably need a serial inverter or some other access to the non-inverted SBUS data. Some receivers have hacks available to pull off the non-inverted data without needing to purchase a serial inverter.

BungalowBill68 commented 1 year ago

I had a hardware inverter going into the SERCOM, but I ended up solving my software issue by going through a different library, which did accept a SERCOM port as an argument. I'm still not sure why this library didn't like it but It's fixed now thank you Brian.