|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2014 Freie Universität Berlin, Hinnerk van Bruinehsen
|
|
|
|
|
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
|
* 2014 Freie Universität Berlin, Hinnerk van Bruinehsen
|
|
|
|
|
*
|
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
@ -20,14 +21,16 @@
|
|
|
|
|
* @author Stefan Pfeiffer <stefan.pfeiffer@fu-berlin.de>
|
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
|
|
|
* @author Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
|
|
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __ATMEGA_COMMON_H
|
|
|
|
|
#define __ATMEGA_COMMON_H
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
|
#include "cpu_conf.h"
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -43,6 +46,27 @@ extern "C" {
|
|
|
|
|
#define eINT enableIRQ
|
|
|
|
|
#define dINT disableIRQ
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief global in-ISR state variable
|
|
|
|
|
*/
|
|
|
|
|
extern volatile uint8_t __in_isr;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Flag entering of an ISR
|
|
|
|
|
*/
|
|
|
|
|
static inline void __enter_isr(void)
|
|
|
|
|
{
|
|
|
|
|
__in_isr = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Flag exiting of an ISR
|
|
|
|
|
*/
|
|
|
|
|
static inline void __exit_isr(void)
|
|
|
|
|
{
|
|
|
|
|
__in_isr = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Initialization of the CPU
|
|
|
|
|
*/
|
|
|
|
|