Move global interrupt enable/disable functions out to Common.h and document them.
This commit is contained in:
parent
de9bd767dc
commit
c263ea837a
13 changed files with 127 additions and 104 deletions
|
@ -199,8 +199,8 @@
|
|||
|
||||
static inline void USB_Device_GetSerialString(uint16_t* UnicodeString)
|
||||
{
|
||||
uint_reg_t CurrentGlobalInt = USB_INT_GetGlobalEnableState();
|
||||
USB_INT_GlobalDisable();
|
||||
uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
|
||||
GlobalInterruptDisable();
|
||||
|
||||
uint8_t SigReadAddress = 0x0E;
|
||||
|
||||
|
@ -220,7 +220,7 @@
|
|||
(('A' - 10) + SerialByte) : ('0' + SerialByte));
|
||||
}
|
||||
|
||||
USB_INT_SetGlobalEnableState(CurrentGlobalInt);
|
||||
SetGlobalInterruptMask(CurrentGlobalInt);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -263,7 +263,7 @@ ISR(USB_COM_vect, ISR_BLOCK)
|
|||
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
|
||||
USB_INT_Disable(USB_INT_RXSTPI);
|
||||
|
||||
USB_INT_GlobalEnable();
|
||||
GlobalInterruptEnable();
|
||||
|
||||
USB_Device_ProcessControlRequest();
|
||||
|
||||
|
|
|
@ -84,37 +84,6 @@
|
|||
};
|
||||
|
||||
/* Inline Functions: */
|
||||
static inline uint_reg_t USB_INT_GetGlobalEnableState(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint_reg_t USB_INT_GetGlobalEnableState(void)
|
||||
{
|
||||
GCC_MEMORY_BARRIER();
|
||||
return SREG;
|
||||
}
|
||||
|
||||
static inline void USB_INT_SetGlobalEnableState(uint_reg_t GlobalIntState) ATTR_ALWAYS_INLINE;
|
||||
static inline void USB_INT_SetGlobalEnableState(uint_reg_t GlobalIntState)
|
||||
{
|
||||
GCC_MEMORY_BARRIER();
|
||||
SREG = GlobalIntState;
|
||||
GCC_MEMORY_BARRIER();
|
||||
}
|
||||
|
||||
static inline void USB_INT_GlobalEnable(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void USB_INT_GlobalEnable(void)
|
||||
{
|
||||
GCC_MEMORY_BARRIER();
|
||||
sei();
|
||||
GCC_MEMORY_BARRIER();
|
||||
}
|
||||
|
||||
static inline void USB_INT_GlobalDisable(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void USB_INT_GlobalDisable(void)
|
||||
{
|
||||
GCC_MEMORY_BARRIER();
|
||||
cli();
|
||||
GCC_MEMORY_BARRIER();
|
||||
}
|
||||
|
||||
static inline void USB_INT_Enable(const uint8_t Interrupt) ATTR_ALWAYS_INLINE;
|
||||
static inline void USB_INT_Enable(const uint8_t Interrupt)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue