#ifndef _NVIC_H_
#define _NVIC_H_
//-----------------------------------------------------------------------------
//
//
//
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------


#if defined STM32
   #include <HALWrapper/stm32.h>
#endif


#if defined(STM32F0)
   // between 0 and 15; low value means high priority
   #define  NVI_LOW_PRIORITY           0x3
   #define  NVI_LOWER_PRIORITY         0x2
   #define  NVI_DEFAULT_PRIORITY       0x2
   #define  NVI_HIGHER_PRIORITY        0x1
   #define  NVI_EVENHIGHER_PRIORITY    0x1
   #define  NVI_HIGH_PRIORITY          0x0
#else
   // between 0 and 15; low value means high priority
   #define  NVI_LOW_PRIORITY           0xF
   #define  NVI_LOWER_PRIORITY         0xB
   #define  NVI_DEFAULT_PRIORITY       0x7
   #define  NVI_HIGHER_PRIORITY        0x3
   #define  NVI_EVENHIGHER_PRIORITY    0x2
   #define  NVI_HIGH_PRIORITY          0x0
#endif


/*
#define  NVI_DEFAULT_PRIORITY    0x30
#define  NVI_LOW_PRIORITY        0xB0
#define  NVI_HIGH_PRIORITY       0x70
*/


void setNVInterrupt(IRQn_Type irqChannel
                    , bool enabled /*=true*/
                    , int preemptionPriority /*NVI_DEFAULT_PRIORITY*/
                    );


//---fin-----------------------------------------------------------------------
#endif
