Skip to content

Commit

Permalink
Version 2.0.6 : fix tryToSend interrupt disabling (thanks to Fergus D…
Browse files Browse the repository at this point in the history
…uncan)
  • Loading branch information
pierremolinaro committed Oct 10, 2020
1 parent 2a04087 commit 50a03e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Binary file modified extras/acan2515.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ACAN2515
version=2.0.5
version=2.0.6
author=Pierre Molinaro
maintainer=Pierre Molinaro <[email protected]>
sentence=Driver for MCP2515 CAN Controller
Expand Down
9 changes: 4 additions & 5 deletions src/ACAN2515.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,14 +868,13 @@ uint8_t ACAN2515::receiveErrorCounter (void) {
//----------------------------------------------------------------------------------------------------------------------

bool ACAN2515::tryToSend (const CANMessage & inMessage) {
//--- Find send buffer index
//--- Fix send buffer index
uint8_t idx = inMessage.idx ;
if (idx > 2) {
idx = 0 ;
}
//--- Workaround: the Teensy 3.5 / 3.6 "SPI.usingInterrupt" bug
// https://github.com/PaulStoffregen/SPI/issues/35
#if (defined (__MK64FX512__) || defined (__MK66FX1M0__))
//--- Bug fix in 2.0.6 (thanks to Fergus Duncan): interrupts were only disabled for Teensy boards
#ifndef ARDUINO_ARCH_ESP32
noInterrupts () ;
#endif
//---
Expand All @@ -888,7 +887,7 @@ bool ACAN2515::tryToSend (const CANMessage & inMessage) {
ok = mTransmitBuffer [idx].append (inMessage) ;
}
mSPI.endTransaction () ;
#if (defined (__MK64FX512__) || defined (__MK66FX1M0__))
#ifndef ARDUINO_ARCH_ESP32
interrupts () ;
#endif
return ok ;
Expand Down

0 comments on commit 50a03e1

Please sign in to comment.