Go to file
cousteau e2016d57de Check for valid pin properly (fixes #4605)
Fix for `pinMode()`, `digitalWrite()`, `digitalRead()` (issue #4605).
Current behavior: look up pin number in `digital_pin_to_port_PGM[]` and then check if it returned `NOT_A_PIN`.  Causes undefined behavior if provided `pin` number is out of the range of `digital_pin_to_port_PGM[]`.
Proposed behavior (from issue #4605): check if `pin` is within the valid range of `digital_pin_to_port_PGM[]`, and THEN look it up.

Additionally, remove second check for `port` not being `NOT_A_PIN` (which was useful for boards where the pin numbering skips some numbers).  This can still be achieved by making `bit = digitalPinToBitMask(pin)` be 0 for invalid pins, which causes further bitwise operations such as `*reg &= ~bit;` and `*out |= bit;` to not actually modify the value of the register.  (This removal makes the operation complete a bit faster for valid pins and slower for invalid pins, which I think is a good trade; plus it saves binary size.)
2017-11-13 17:22:33 +01:00
bootloaders Adding Arduino.org new boards 2016-12-16 10:59:00 +01:00
cores/arduino Check for valid pin properly (fixes #4605) 2017-11-13 17:22:33 +01:00
extras Add extras folder for packagein and CI 2017-11-13 11:53:21 +01:00
firmwares Added support to Genuino boards (drivers, boards.txt entries, bootloaders) 2015-08-27 10:40:03 +02:00
libraries [WIRE] Remove extra line from digital_potentiometer example 2017-11-13 12:42:12 +01:00
variants Added Adafruit Circuits Playground board 2016-12-14 15:00:23 +01:00
boards.txt Use correct part names in Tools > Processor menus 2017-07-18 12:22:43 +02:00
platform.txt Update bundled avr core to 1.6.20 2017-08-18 15:58:02 +02:00
programmers.txt Updated Arduino as ISP setting 2017-11-13 16:37:40 +01:00