core/irq.h: add irq_is_enabled() function
This commit is contained in:
parent
2de7dab0f4
commit
b526394d82
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2013 Freie Universität Berlin
|
* Copyright (C) 2013,2019 Freie Universität Berlin
|
||||||
*
|
*
|
||||||
* This file is subject to the terms and conditions of the GNU Lesser
|
* 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
|
* General Public License v2.1. See the file LICENSE in the top level
|
||||||
@ -16,6 +16,7 @@
|
|||||||
* @brief IRQ driver interface
|
* @brief IRQ driver interface
|
||||||
*
|
*
|
||||||
* @author Freie Universität Berlin, Computer Systems & Telematics
|
* @author Freie Universität Berlin, Computer Systems & Telematics
|
||||||
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef IRQ_H
|
#ifndef IRQ_H
|
||||||
@ -67,6 +68,17 @@ MAYBE_INLINE unsigned irq_enable(void);
|
|||||||
*/
|
*/
|
||||||
MAYBE_INLINE void irq_restore(unsigned state);
|
MAYBE_INLINE void irq_restore(unsigned state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Test if IRQs are currently enabled
|
||||||
|
*
|
||||||
|
* @warning Use this function from thread context only. When used in interrupt
|
||||||
|
* context the returned state may be incorrect.
|
||||||
|
*
|
||||||
|
* @return 0 (false) if IRQs are currently disabled
|
||||||
|
* @return != 0 (true) if IRQs are currently enabled
|
||||||
|
*/
|
||||||
|
MAYBE_INLINE int irq_is_enabled(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check whether called from interrupt service routine
|
* @brief Check whether called from interrupt service routine
|
||||||
* @return true, if in interrupt service routine, false if not
|
* @return true, if in interrupt service routine, false if not
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user