Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Interruptable ISR #28

Open
wangnick opened this issue May 31, 2021 · 3 comments
Open

Feature request: Interruptable ISR #28

wangnick opened this issue May 31, 2021 · 3 comments

Comments

@wangnick
Copy link

wangnick commented May 31, 2021

Hi Pierre,

I found that I can allow the ISR to be interruptable, thereby lowering the latency of other interrupts significantly, as follows:

static void can_isr () { // We don't want to block interrupts whilst performing low-level CAN processing ...
  detachInterrupt(digitalPinToInterrupt(CAN_INT)) ;
  interrupts();
  can.isr();
  noInterrupts();
  attachInterrupt(digitalPinToInterrupt(CAN_INT),can_isr,LOW);
}

However, that's a bit of a hassle, including the attachInterrupt after ACAN2515::begin and the detachInterrupt prior to ACAN2515::end.

Can you add ISR interuptability as an option?

Kind regards,
Sebastian

@pierremolinaro
Copy link
Owner

pierremolinaro commented Jun 4, 2021 via email

@wangnick
Copy link
Author

wangnick commented Jun 4, 2021

Hi Pierre, this is on an Atmega328PB, but I guess it should work on all AVR 8-bit platforms. I guess you are concerned about the ESP32?

Kind regards,
Sebastian

@pierremolinaro
Copy link
Owner

pierremolinaro commented Jun 6, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants