From b24866225a6301d3a663f874725e83c012dc25d3 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Wed, 26 Dec 2012 17:36:00 +0100 Subject: digital/beacon: add bitcloud stack into common directory digital/zigbit --- .../HAL/avr/atmega1281/common/include/halAtomic.h | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/include/halAtomic.h (limited to 'digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/include/halAtomic.h') diff --git a/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/include/halAtomic.h b/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/include/halAtomic.h new file mode 100644 index 00000000..245abf6f --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/include/halAtomic.h @@ -0,0 +1,57 @@ +/**************************************************************************//** + \file halAtomic.h + + \brief Implementation of atomic sections. + + \author + Atmel Corporation: http://www.atmel.com \n + Support email: avr@atmel.com + + Copyright (c) 2008-2011, Atmel Corporation. All rights reserved. + Licensed under Atmel's Limited License Agreement (BitCloudTM). + + \internal + History: + 29/05/07 E. Ivanov - Created + ******************************************************************************/ +/****************************************************************************** + * WARNING: CHANGING THIS FILE MAY AFFECT CORE FUNCTIONALITY OF THE STACK. * + * EXPERT USERS SHOULD PROCEED WITH CAUTION. * + ******************************************************************************/ + +#ifndef _HALATOMIC_H +#define _HALATOMIC_H + +#include + +typedef uint8_t atomic_t; + +/****************************************************************************** +Saves global interrupt bit. Disables global interrupt. +Parameters: + none. +Returns: + none. +******************************************************************************/ +INLINE atomic_t halStartAtomic(void) +{ + atomic_t result = SREG; + cli(); + return result; +} + +/****************************************************************************** +Restores global interrupt. +Parameters: + none. +Returns: + none. +******************************************************************************/ +INLINE void halEndAtomic(atomic_t sreg) +{ + SREG = sreg; +} + +#endif /* _HALATOMIC_H */ +// eof atomic.h + -- cgit v1.2.3