davidcole1340 / mcp2515-rs

`#![no_std]` library for interacting with MCP2515 CAN controller chips.
Apache License 2.0
21 stars 10 forks source link

Unclear how interrupts work #8

Open cschleifenbaum opened 1 month ago

cschleifenbaum commented 1 month ago

I'm trying to react on new data via interrupt. For that I enabled gpio::Interrupt::EdgeLow on the GPIO pin. That is even triggered on new data.

If I send a few packets here and there this works like a charm. I clear the interrupt after I read all messages available (read_message until Err(Error::NoMessage)). In the interrupt handler I simply sent the same message but with a different CAN id. But if data come in all the time (I connected it to my car) this works just for the first 5 or 6 messages and then it stops processing. Am I using the wrong approach?

All taht ona Raspberry Pi Pico, btw, in case that makes a difference.

cschleifenbaum commented 1 month ago

I have the feeling the RX buffer overflow register might bt set. How do I unset it?