Skip to content

Commit

Permalink
Use IRAM_ATTR, fixes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Apr 9, 2022
1 parent a40be01 commit eb73cf7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ class Encoder
// update() is not meant to be called from outside Encoder,
// but it is public to allow static interrupt routines.
// DO NOT call update() directly from sketches.
#if defined(IRAM_ATTR)
static IRAM_ATTR void update(Encoder_internal_state_t *arg) {
#else
static void update(Encoder_internal_state_t *arg) {
#endif
#if defined(__AVR__)
// The compiler believes this is just 1 line of code, so
// it will inline this function into each interrupt
Expand Down

0 comments on commit eb73cf7

Please sign in to comment.