tenbaht / sduino

An Arduino-like programming API for the STM8
http://tenbaht.github.io/sduino/
GNU Lesser General Public License v2.1
347 stars 213 forks source link

IRQ example not quite right #135

Open dirkx opened 2 years ago

dirkx commented 2 years ago

The IRQ example for attachInterrupt(pin, hander, mode) shows the

attachInterrupt(digitalPinToInterrupt(pin), ISR, mode)

as the recommended example. This has two issues I think; first digitalPinToInterrupt() does not exist; but more seriously - the argument expected in attachInterrupt() is passed to digitalPinToPort() -and- is passed/used in the mask with digitalPinToBitMask(). So it should actually be the real pin.