]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/atm128/atm128hardware.h
Remove bogus 'tab:4' and 'tab:2' markers.
[tinyos-2.x.git] / tos / chips / atm128 / atm128hardware.h
index 7ef731ca8704132217d2a37be097df9361c141bb..9cc0e93797df5dc1c5a93ce1e586073ef7b39205 100644 (file)
@@ -1,6 +1,6 @@
 //  $Id$
 
-/*                                                                     tab:4
+/*                                                                     
  *  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.  By
  *  downloading, copying, installing or using the software you agree to
  *  this license.  If you do not agree to this license, do not download,
 #define _H_atmega128hardware_H
 
 #include <avr/io.h>
-#include <avr/signal.h>
+#if __AVR_LIBC_VERSION__ >= 10400UL
+#include <avr/interrupt.h>
+#else
 #include <avr/interrupt.h>
+#include <avr/signal.h>
+#endif
 #include <avr/wdt.h>
 #include <avr/pgmspace.h>
 #include "atm128const.h"
@@ -100,6 +104,7 @@ __nesc_atomic_start(void) @spontaneous()
 {
     __nesc_atomic_t result = SREG;
     __nesc_disable_interrupt();
+    asm volatile("" : : : "memory"); /* ensure atomic section effect visibility */
     return result;
 }
 
@@ -107,6 +112,7 @@ __nesc_atomic_start(void) @spontaneous()
 inline void 
 __nesc_atomic_end(__nesc_atomic_t original_SREG) @spontaneous()
 {
+  asm volatile("" : : : "memory"); /* ensure atomic section effect visibility */
   SREG = original_SREG;
 }
 #endif
@@ -130,3 +136,5 @@ mcu_power_t mcombine(mcu_power_t m1, mcu_power_t m2) {
 }
 
 #endif //_H_atmega128hardware_H
+
+