aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/Misc
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-04-08 05:40:25 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-04-08 05:40:25 +0000
commit6384d33171686c06698b5d34562245a290d44f62 (patch)
treea899d943856b48f6889cf1fe9f5b97ccc58ca598 /LUFA/Drivers/Misc
parent5f7811e9d902b03c6af11f2820cf11b9c0bac154 (diff)
Move global interrupt enable/disable functions out to Common.h and document them.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1731 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/Misc')
-rw-r--r--LUFA/Drivers/Misc/RingBuffer.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/LUFA/Drivers/Misc/RingBuffer.h b/LUFA/Drivers/Misc/RingBuffer.h
index 5c8c8403..50402916 100644
--- a/LUFA/Drivers/Misc/RingBuffer.h
+++ b/LUFA/Drivers/Misc/RingBuffer.h
@@ -125,8 +125,8 @@
{
GCC_FORCE_POINTER_ACCESS(Buffer);
- uint_reg_t CurrentGlobalInt = USB_INT_GetGlobalEnableState();
- USB_INT_GlobalDisable();
+ uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
+ GlobalInterruptDisable();
Buffer->In = DataPtr;
Buffer->Out = DataPtr;
@@ -135,7 +135,7 @@
Buffer->Size = Size;
Buffer->Count = 0;
- USB_INT_SetGlobalEnableState(CurrentGlobalInt);
+ SetGlobalInterruptMask(CurrentGlobalInt);
}
/** Retrieves the minimum number of bytes stored in a particular buffer. This value is computed
@@ -155,12 +155,12 @@
{
uint16_t Count;
- uint_reg_t CurrentGlobalInt = USB_INT_GetGlobalEnableState();
- USB_INT_GlobalDisable();
+ uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
+ GlobalInterruptDisable();
Count = Buffer->Count;
- USB_INT_SetGlobalEnableState(CurrentGlobalInt);
+ SetGlobalInterruptMask(CurrentGlobalInt);
return Count;
}
@@ -213,12 +213,12 @@
if (++Buffer->In == Buffer->End)
Buffer->In = Buffer->Start;
- uint_reg_t CurrentGlobalInt = USB_INT_GetGlobalEnableState();
- USB_INT_GlobalDisable();
+ uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
+ GlobalInterruptDisable();
Buffer->Count++;
- USB_INT_SetGlobalEnableState(CurrentGlobalInt);
+ SetGlobalInterruptMask(CurrentGlobalInt);
}
/** Removes an element from the ring buffer.
@@ -240,12 +240,12 @@
if (++Buffer->Out == Buffer->End)
Buffer->Out = Buffer->Start;
- uint_reg_t CurrentGlobalInt = USB_INT_GetGlobalEnableState();
- USB_INT_GlobalDisable();
+ uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
+ GlobalInterruptDisable();
Buffer->Count--;
- USB_INT_SetGlobalEnableState(CurrentGlobalInt);
+ SetGlobalInterruptMask(CurrentGlobalInt);
return Data;
}