Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielgarcia@gmail.com <danielgarcia@gmail.com@4ad4ec5c-605d-bd5c-5796-512c9b60011b>2013-11-10 05:36:14 +0400
committerdanielgarcia@gmail.com <danielgarcia@gmail.com@4ad4ec5c-605d-bd5c-5796-512c9b60011b>2013-11-10 05:36:14 +0400
commite9d4489e508a99dc9e949f7762c2d6f3529524bb (patch)
treedb02d9fe781a3bdbc3b6ebd5af148f6ffe1c7f91 /fastpin.h
parent7185b516211105fc9644063548240c0057d77012 (diff)
parentadc78ce93b7b6b009aab35e9fce94074920b6bf5 (diff)
Sync w/main FastSPI_LED2 branch
Diffstat (limited to 'fastpin.h')
-rw-r--r--fastpin.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/fastpin.h b/fastpin.h
index 386fbb98..e3ba5c99 100644
--- a/fastpin.h
+++ b/fastpin.h
@@ -28,7 +28,11 @@ public:
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+#define _CYCLES(_PIN) (((_PIN >= 62 ) || (_PIN>=42 && _PIN<=49) || (_PIN>=14 && _PIN <=17) || (_PIN>=6 && _PIN <=9)) ? 2 : 1)
+#else
#define _CYCLES(_PIN) ((_PIN >= 24) ? 2 : 1)
+#endif
class Selectable {
public:
@@ -326,8 +330,17 @@ typedef volatile uint32_t * ptr_reg32_t;
// built on, then much higher speed access will be possible, namely with direct GPIO register accesses.
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////
+#if defined(FORCE_SOFTWARE_PINS)
+#warning "Softwrae pin support forced pin access will be slightly slower. See fastpin.h for info."
+#define NO_HARDWARE_PIN_SUPPORT
+
+#elif defined(__AVR_ATtiny85__)
+_IO(B);
+
+_DEFPIN_AVR(0, 0x01, B); _DEFPIN_AVR(1, 0x02, B); _DEFPIN_AVR(2, 0x04, B); _DEFPIN_AVR(3, 0x08, B);
+_DEFPIN_AVR(4, 0x10, B); _DEFPIN_AVR(5, 0x20, B);
-#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
+#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
// Accelerated port definitions for arduino avrs
_IO(D); _IO(B); _IO(C);