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:
authorDaniel Garcia <danielgarcia@gmail.com>2013-11-24 07:14:20 +0400
committerDaniel Garcia <danielgarcia@gmail.com>2013-11-24 07:14:20 +0400
commit365ceb1b99c0af86abf12c9830c33e4149fe7f2d (patch)
tree10441de8326aef8adf61860efc90fa53ced9a3f6
parent8c4534b16b144a4ff02a261e5a8ff744e020cc90 (diff)
Fixing some nop constants in delay.h to make them better
-rw-r--r--delay.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/delay.h b/delay.h
index c29de694..a6fff105 100644
--- a/delay.h
+++ b/delay.h
@@ -9,8 +9,10 @@
#if defined(__arm__)
# define NOP __asm__ __volatile__ ("nop\n");
+# define NOP2 __asm__ __volatile__ ("nop\n\tnop");
#else
# define NOP __asm__ __volatile__ ("cp r0,r0\n");
+# define NOP2 __asm__ __volatile__ ("rjmp .+0");
#endif
// predeclaration to not upset the compiler
@@ -54,9 +56,9 @@ template<> __attribute__((always_inline)) inline void delaycycles<-2>() {}
template<> __attribute__((always_inline)) inline void delaycycles<-1>() {}
template<> __attribute__((always_inline)) inline void delaycycles<0>() {}
template<> __attribute__((always_inline)) inline void delaycycles<1>() {NOP;}
-template<> __attribute__((always_inline)) inline void delaycycles<2>() {NOP;NOP;}
-template<> __attribute__((always_inline)) inline void delaycycles<3>() {NOP;NOP;NOP;}
-template<> __attribute__((always_inline)) inline void delaycycles<4>() {NOP;NOP;NOP;NOP;}
-template<> __attribute__((always_inline)) inline void delaycycles<5>() {NOP;NOP;NOP;NOP;NOP;}
+template<> __attribute__((always_inline)) inline void delaycycles<2>() {NOP2;}
+template<> __attribute__((always_inline)) inline void delaycycles<3>() {NOP;NOP2;}
+template<> __attribute__((always_inline)) inline void delaycycles<4>() {NOP2;NOP2;}
+template<> __attribute__((always_inline)) inline void delaycycles<5>() {NOP2;NOP2;NOP;}
#endif \ No newline at end of file