Project

General

Profile

Revision 1142

Merged new orbs code
Added atomic.h
Fixed whitespace in eeprom.h

View differences:

dragonfly_lib.h
80 80
#include <util/delay.h>
81 81
#include <util/twi.h>
82 82

  
83
// This file is included from the libdragonfly directory because it seems to be
84
// missing from the AVR libc distribution.
85
#include "atomic.h"
86

  
83 87
#include <analog.h>
84 88
#include <dio.h>
85 89
#include <time.h>
......
94 98
#include <reset.h>
95 99
#include <math.h>
96 100
#include <eeprom.h>
101
#include <stdbool.h>
97 102

  
103
/** @brief shortcut for ATOMIC_BLOCK(ATOMIC_RESTORESTATE) **/
104
#define SYNC ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
105

  
106
/** @brief atomically grab a lock if it is free, return otherwise **/
107
#define REQUIRE_LOCK_OR_RETURN(LOCK) do { SYNC { if (LOCK) return; LOCK=1; } } while (0)
108

  
109
/** @brief atomically release a lock **/
110
#define RELEASE_LOCK(LOCK) do { LOCK=0; } while (0)
111

  
112

  
113

  
98 114
#endif
99 115

  

Also available in: Unified diff