2011-08-14 12:49:07 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
|
|
* @{
|
|
|
|
* @addtogroup PIOS_IRQ IRQ Setup Functions
|
|
|
|
* @brief STM32 Hardware code to enable and disable interrupts
|
|
|
|
* @{
|
|
|
|
*
|
2013-05-18 14:17:26 +02:00
|
|
|
* @file pios_irq.c
|
2011-08-14 12:49:07 +02:00
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
2013-05-18 14:17:26 +02:00
|
|
|
* Parts by Thorsten Klose (tk@midibox.org) (tk@midibox.org)
|
2011-08-14 12:49:07 +02:00
|
|
|
* @brief IRQ Enable/Disable routines
|
|
|
|
* @see The GNU Public License (GPL) Version 3
|
2013-05-18 14:17:26 +02:00
|
|
|
*
|
2011-08-14 12:49:07 +02:00
|
|
|
*****************************************************************************/
|
2013-05-18 14:17:26 +02:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2011-08-14 12:49:07 +02:00
|
|
|
* (at your option) any later version.
|
2013-05-18 14:17:26 +02:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
2011-08-14 12:49:07 +02:00
|
|
|
* for more details.
|
2013-05-18 14:17:26 +02:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
2011-08-14 12:49:07 +02:00
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Project Includes */
|
|
|
|
#include "pios.h"
|
|
|
|
|
|
|
|
#if defined(PIOS_INCLUDE_IRQ)
|
|
|
|
|
|
|
|
/* Private Function Prototypes */
|
|
|
|
|
|
|
|
/**
|
2013-05-18 14:17:26 +02:00
|
|
|
* Disables all interrupts (nested)
|
|
|
|
* \return < 0 On errors
|
|
|
|
*/
|
2011-08-14 12:49:07 +02:00
|
|
|
int32_t PIOS_IRQ_Disable(void)
|
|
|
|
{
|
|
|
|
#if defined(PIOS_INCLUDE_FREERTOS)
|
2013-05-18 14:17:26 +02:00
|
|
|
taskENTER_CRITICAL();
|
2011-08-14 12:49:07 +02:00
|
|
|
#endif
|
2013-05-18 14:17:26 +02:00
|
|
|
return 0;
|
2011-08-14 12:49:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-05-18 14:17:26 +02:00
|
|
|
* Enables all interrupts (nested)
|
|
|
|
* \return < 0 on errors
|
|
|
|
* \return -1 on nesting errors (PIOS_IRQ_Disable() hasn't been called before)
|
|
|
|
*/
|
2011-08-14 12:49:07 +02:00
|
|
|
int32_t PIOS_IRQ_Enable(void)
|
|
|
|
{
|
|
|
|
#if defined(PIOS_INCLUDE_FREERTOS)
|
2013-05-18 14:17:26 +02:00
|
|
|
taskEXIT_CRITICAL();
|
2011-08-14 12:49:07 +02:00
|
|
|
#endif
|
2013-05-18 14:17:26 +02:00
|
|
|
return 0;
|
2011-08-14 12:49:07 +02:00
|
|
|
}
|
|
|
|
|
2013-05-18 14:17:26 +02:00
|
|
|
#endif /* if defined(PIOS_INCLUDE_IRQ) */
|
2011-08-14 12:49:07 +02:00
|
|
|
|
|
|
|
/**
|
2013-05-18 14:17:26 +02:00
|
|
|
* @}
|
|
|
|
* @}
|
|
|
|
*/
|