2018-09-05 02:39:50 +02:00
|
|
|
/*
|
2019-09-05 13:35:58 +02:00
|
|
|
* Copyright (C) 2019 Gunar Schorcht
|
2018-09-05 02:39:50 +02:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2019-12-16 07:41:40 +01:00
|
|
|
* @ingroup cpu_esp_common
|
2018-09-05 02:39:50 +02:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Implementation of the kernels irq interface
|
|
|
|
*
|
|
|
|
* @author Gunar Schorcht <gunar@schorcht.net>
|
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "esp/common_macros.h"
|
|
|
|
|
2020-10-22 01:07:14 +02:00
|
|
|
#define ENABLE_DEBUG 0
|
|
|
|
#include "debug.h"
|
|
|
|
|
2018-09-05 02:39:50 +02:00
|
|
|
/**
|
|
|
|
* @brief Set on entry into and reset on exit from an ISR
|
|
|
|
*/
|
|
|
|
volatile uint32_t irq_interrupt_nesting = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief See if the current context is inside an ISR
|
|
|
|
*/
|
2021-12-08 15:53:15 +01:00
|
|
|
bool IRAM irq_is_in(void)
|
2018-09-05 02:39:50 +02:00
|
|
|
{
|
2022-06-25 12:47:59 +02:00
|
|
|
DEBUG("irq_interrupt_nesting = %" PRIu32 "\n", irq_interrupt_nesting);
|
2018-09-05 02:39:50 +02:00
|
|
|
return irq_interrupt_nesting;
|
|
|
|
}
|