28 lines
406 B
C
28 lines
406 B
C
|
/*
|
||
|
* stm32f4xx_irq.c
|
||
|
*
|
||
|
* Created on: Oct 1, 2015
|
||
|
* Author: tkl
|
||
|
*/
|
||
|
#include "stm32f4xx.h"
|
||
|
#include "stm32f4xx_irq.h"
|
||
|
|
||
|
unsigned int disable_irq(void)
|
||
|
{
|
||
|
unsigned int state = __get_PRIMASK();
|
||
|
__disable_irq();
|
||
|
return state;
|
||
|
}
|
||
|
|
||
|
unsigned int enable_irq(void)
|
||
|
{
|
||
|
unsigned int state = __get_PRIMASK();
|
||
|
__enable_irq();
|
||
|
return state;
|
||
|
}
|
||
|
|
||
|
void restore_irq(unsigned int state)
|
||
|
{
|
||
|
__set_PRIMASK(state);
|
||
|
}
|