sleemanj / optiboot

Small and Fast Bootloader for Arduino and other Atmel AVR chips
66 stars 13 forks source link

digitalPinToInterrupt(PIN_X) does not work #22

Closed skaman82 closed 2 years ago

skaman82 commented 3 years ago

Code:
attachInterrupt( digitalPinToInterrupt(2) , isr, CHANGE ) ;

Compiler Error: 'sketch/IrNec.cpp: In function 'void nsIrNec::begin(uint8_t)': IrNec.cpp:115:43: error: 'digitalPinToInterrupt' was not declared in this scope attachInterrupt( digitalPinToInterrupt(2) , isr, CHANGE ) ; ^ exit status 1 'digitalPinToInterrupt' was not declared in this scope'

Compiling for ATtiny85

sleemanj commented 3 years ago

Timy 85 only has one external interrupt, just use it directly.

attachInterrupt( 0, isr, CHANGE ) ;

---- On Thu, 21 Jan 2021 23:38:44 +1300 Albert Kravcov notifications@github.com wrote ----

Code: attachInterrupt( digitalPinToInterrupt(2) , isr, CHANGE ) ; Compiler Error: 'sketch/IrNec.cpp: In function 'void nsIrNec::begin(uint8_t)': IrNec.cpp:115:43: error: 'digitalPinToInterrupt' was not declared in this scope attachInterrupt( digitalPinToInterrupt(2) , isr, CHANGE ) ; ^ exit status 1 'digitalPinToInterrupt' was not declared in this scope' Compiling for ATtiny85

— You are receiving this because you are subscribed to this thread. Reply to this email directly, https://github.com/sleemanj/optiboot/issues/22, or https://github.com/notifications/unsubscribe-auth/AABSS2JUAM46ZSQJIGU5LLDS2773JANCNFSM4WMUGBNQ.

skaman82 commented 3 years ago

thanks, that helped

sleemanj commented 3 years ago

I'll leave this open since I should fix it sometime.

(Specificially I think this is already fixed in the SpenceKonde work pending merging)

sleemanj commented 2 years ago

Fixed in 2022.3.10 release