digistump / DigistumpArduino

Files to add Digistump support (Digispark, Pro, DigiX) to Arduino 1.6.X (1.6.5+)
932 stars 377 forks source link

TinyPinChange_FallingEdge typo in TinyPinChange library #160

Open slovekkania opened 1 year ago

slovekkania commented 1 year ago

Hi the macro: TinyPinChange_FallingEdge returns true for both rising and falling edge instead of falling edge only

instead of this: #define TinyPinChange_FallingEdge(VirtualPortIdx, Pin) ( TinyPinChange_GetPortEvent((VirtualPortIdx)) & TinyPinChange_PinToMsk((Pin)) & (TinyPinChange_GetCurPortSt((VirtualPortIdx) ^ 0xFF)) )

should be this: #define TinyPinChange_FallingEdge(VirtualPortIdx, Pin) ( TinyPinChange_GetPortEvent((VirtualPortIdx)) & TinyPinChange_PinToMsk((Pin)) & (TinyPinChange_GetCurPortSt((VirtualPortIdx)) ^ 0xFF) )

wrong position of ^ 0xFF

please check and fix :)

slovekkania commented 1 year ago

the library author fixed this bug. most recent library is here: https://github.com/RC-Navy/DigisparkArduinoIntegration/tree/master/libraries/DigisparkTinyPinChange

and should be replaced