diff options
author | Hugo Woesthuis <hugow2011@outlook.com> | 2019-02-21 07:21:57 +0300 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2019-02-21 07:21:57 +0300 |
commit | 6fafed5114e9e3b6d38c1b0d9c59ac29a008d649 (patch) | |
tree | f73a312068a33f0f96da015280197e0c6d827380 | |
parent | 84f68205f0222735c46a208b44b480cd618dbe67 (diff) |
Fix ATtiny25 compilation issue (port definitions) (#728)
* Fix ATtiny25 compilation issue
The ATtiny25 does not have PORTA. It would give compilation errors.
Also, because the ATtiny25 has a very small storage capacity, a compilation message will be presented warning the user.
* Update fastpin_avr.h
* Fix char type
-rw-r--r-- | platforms/avr/fastpin_avr.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/platforms/avr/fastpin_avr.h b/platforms/avr/fastpin_avr.h index 8cfd96ea..4e25cf8d 100644 --- a/platforms/avr/fastpin_avr.h +++ b/platforms/avr/fastpin_avr.h @@ -51,9 +51,13 @@ typedef volatile uint8_t & reg8_t; #define _IO(L) _RD8(DDR ## L); _RD8(PORT ## L); _RD8(PIN ## L); #define _DEFPIN_AVR(_PIN, MASK, L) template<> class FastPin<_PIN> : public _AVRPIN<_PIN, MASK, _R(PORT ## L), _R(DDR ## L), _R(PIN ## L)> {}; -#if defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny45__) +#if defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny25__) _IO(B); +#if defined(__AVR_ATtiny25__) +#pragma message "ATtiny25 has very limited storage. This library could use up to more than 100% of its flash size" +#endif + #define MAX_PIN 5 _DEFPIN_AVR(0, 0x01, B); _DEFPIN_AVR(1, 0x02, B); _DEFPIN_AVR(2, 0x04, B); _DEFPIN_AVR(3, 0x08, B); @@ -80,7 +84,7 @@ _IO(A); _IO(B); _DEFPIN_AVR(0, 0x01, B); _DEFPIN_AVR(1, 0x02, B); _DEFPIN_AVR(2, 0x04, B); _DEFPIN_AVR(3, 0x80, A); _DEFPIN_AVR(4, 0x40, A); _DEFPIN_AVR(5, 0x20, A); -#elif defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny25__) +#elif defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) _IO(A); _IO(B); #define MAX_PIN 10 |