Forum Rule: Always post complete source code & details to reproduce any issue!
Page 26 of 26 FirstFirst ... 16 24 25 26
Results 626 to 629 of 629

Thread: FlexCAN_T4 - FlexCAN for Teensy 4

  1. #626
    If you are using a library like MegaCAN, which will parse the message IDs and data, fifo with interrupt probably makes the most sense.

  2. #627
    Junior Member
    Join Date
    Dec 2020
    Posts
    6
    Hi,

    Is there somewhere I can find more detailed documentation for this library? The git page assumes you understand why mailboxes and FIFO would be useful, and Im looking for more information on these.

    I am also trying to understand how the interrupts for this library work. I know system interrupts should be very lean, and Im not sure if changing code in the canSniff function (argument of onReceive) is a bad idea.

    Long story short, I am trying to implement a double click detection function using this library (if button press can packet detected twice within 400ms, then double click, else, single click). I had this function working perfectly using a different microcontroller and can library but I can not get it working properly with the FIFO setup here.

    Id like to try and sort this out myself, but the lack of documentation is making this difficult.

    Thanks for the help,
    Alex

  3. #628
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,659
    if you don't use events(), message reception is fired directly to callbacks. I too use CAN button counting for OEM keyfob to control windows and sunroof, obviously you need to count them not in the callback scope only, I used a circular buffer to store the count, you could also use a volatile variable, I used a queue because i can look into the buffer to see the last button pressed (not only count) to engage the feature I want

  4. #629
    Senior Member
    Join Date
    Aug 2014
    Posts
    172
    Quote Originally Posted by msadie View Post
    If you are using a library like MegaCAN, which will parse the message IDs and data, fifo with interrupt probably makes the most sense.
    Presume then that then MegaCAN variable should be volatile?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •