diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-20 06:23:24 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-12-20 06:23:24 +0000 |
commit | b408a5fe62f5ac8be551f4998a6763465a21f053 (patch) | |
tree | 13f0bd95f033472c636e91c580fae79cbdebd438 /Projects | |
parent | e73f05b8b2de5485c97a305b4a7e940bb5636f49 (diff) | |
download | lufa-b408a5fe62f5ac8be551f4998a6763465a21f053.tar.gz lufa-b408a5fe62f5ac8be551f4998a6763465a21f053.tar.bz2 lufa-b408a5fe62f5ac8be551f4998a6763465a21f053.zip |
Add const qualifier to the parameters of Projects' functions where possible.
Diffstat (limited to 'Projects')
-rw-r--r-- | Projects/AVRISP/Lib/ISPProtocol.h | 8 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/ISPTarget.c | 6 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/ISPTarget.h | 7 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/NVMTarget.c | 19 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/NVMTarget.h | 17 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/PDITarget.c | 2 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/PDITarget.h | 2 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/V2Protocol.c | 4 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/V2ProtocolParams.c | 8 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/V2ProtocolParams.h | 8 | ||||
-rw-r--r-- | Projects/Benito/Lib/RingBuff.c | 8 | ||||
-rw-r--r-- | Projects/Benito/Lib/RingBuff.h | 8 | ||||
-rw-r--r-- | Projects/Magstripe/Lib/CircularBitBuffer.c | 6 | ||||
-rw-r--r-- | Projects/Magstripe/Lib/CircularBitBuffer.h | 6 | ||||
-rw-r--r-- | Projects/USBtoSerial/Lib/RingBuff.c | 8 | ||||
-rw-r--r-- | Projects/USBtoSerial/Lib/RingBuff.h | 8 | ||||
-rw-r--r-- | Projects/XPLAINBridge/Lib/RingBuff.c | 8 | ||||
-rw-r--r-- | Projects/XPLAINBridge/Lib/RingBuff.h | 8 |
18 files changed, 72 insertions, 69 deletions
diff --git a/Projects/AVRISP/Lib/ISPProtocol.h b/Projects/AVRISP/Lib/ISPProtocol.h index 273d7a174..305e68cbc 100644 --- a/Projects/AVRISP/Lib/ISPProtocol.h +++ b/Projects/AVRISP/Lib/ISPProtocol.h @@ -66,11 +66,11 @@ /* Function Prototypes: */
void ISPProtocol_EnterISPMode(void);
void ISPProtocol_LeaveISPMode(void);
- void ISPProtocol_ProgramMemory(uint8_t V2Command);
- void ISPProtocol_ReadMemory(uint8_t V2Command);
+ void ISPProtocol_ProgramMemory(const uint8_t V2Command);
+ void ISPProtocol_ReadMemory(const uint8_t V2Command);
void ISPProtocol_ChipErase(void);
- void ISPProtocol_ReadFuseLockSigOSCCAL(uint8_t V2Command);
- void ISPProtocol_WriteFuseLock(uint8_t V2Command);
+ void ISPProtocol_ReadFuseLockSigOSCCAL(const uint8_t V2Command);
+ void ISPProtocol_WriteFuseLock(const uint8_t V2Command);
void ISPProtocol_SPIMulti(void);
#endif
diff --git a/Projects/AVRISP/Lib/ISPTarget.c b/Projects/AVRISP/Lib/ISPTarget.c index d07cb8225..fbe8ad31c 100644 --- a/Projects/AVRISP/Lib/ISPTarget.c +++ b/Projects/AVRISP/Lib/ISPTarget.c @@ -80,7 +80,7 @@ uint8_t ISPTarget_GetSPIPrescalerMask(void) *
* \param[in] ResetTarget Boolean true when the target should be held in reset, false otherwise
*/
-void ISPTarget_ChangeTargetResetLine(bool ResetTarget)
+void ISPTarget_ChangeTargetResetLine(const bool ResetTarget)
{
if (ResetTarget)
{
@@ -108,8 +108,8 @@ void ISPTarget_ChangeTargetResetLine(bool ResetTarget) * \return V2 Protocol status \ref STATUS_CMD_OK if the no timeout occurred, \ref STATUS_RDY_BSY_TOUT or
* \ref STATUS_CMD_TOUT otherwise
*/
-uint8_t ISPTarget_WaitForProgComplete(uint8_t ProgrammingMode, uint16_t PollAddress, uint8_t PollValue,
- uint8_t DelayMS, uint8_t ReadMemCommand)
+uint8_t ISPTarget_WaitForProgComplete(const uint8_t ProgrammingMode, const uint16_t PollAddress, const uint8_t PollValue,
+ const uint8_t DelayMS, const uint8_t ReadMemCommand)
{
uint8_t ProgrammingStatus = STATUS_CMD_OK;
diff --git a/Projects/AVRISP/Lib/ISPTarget.h b/Projects/AVRISP/Lib/ISPTarget.h index 13ca09d3f..445f3f305 100644 --- a/Projects/AVRISP/Lib/ISPTarget.h +++ b/Projects/AVRISP/Lib/ISPTarget.h @@ -62,9 +62,10 @@ /* Function Prototypes: */
uint8_t ISPTarget_GetSPIPrescalerMask(void);
- void ISPTarget_ChangeTargetResetLine(bool ResetTarget);
- uint8_t ISPTarget_WaitForProgComplete(uint8_t ProgrammingMode, uint16_t PollAddress, uint8_t PollValue,
- uint8_t DelayMS, uint8_t ReadMemCommand);
+ void ISPTarget_ChangeTargetResetLine(const bool ResetTarget);
+ uint8_t ISPTarget_WaitForProgComplete(const uint8_t ProgrammingMode, const uint16_t PollAddress,
+ const uint8_t PollValue, const uint8_t DelayMS,
+ const uint8_t ReadMemCommand);
uint8_t ISPTarget_WaitWhileTargetBusy(void);
void ISPTarget_LoadExtendedAddress(void);
diff --git a/Projects/AVRISP/Lib/NVMTarget.c b/Projects/AVRISP/Lib/NVMTarget.c index 009736064..00312d513 100644 --- a/Projects/AVRISP/Lib/NVMTarget.c +++ b/Projects/AVRISP/Lib/NVMTarget.c @@ -42,7 +42,7 @@ *
* \param[in] Register NVM register whose absolute address is to be sent
*/
-void NVMTarget_SendNVMRegAddress(uint8_t Register)
+void NVMTarget_SendNVMRegAddress(const uint8_t Register)
{
/* Determine the absolute register address from the NVM base memory address and the NVM register address */
uint32_t Address = XPROG_Param_NVMBase | Register;
@@ -55,7 +55,7 @@ void NVMTarget_SendNVMRegAddress(uint8_t Register) *
* \param[in] AbsoluteAddress Absolute address to send to the target
*/
-void NVMTarget_SendAddress(uint32_t AbsoluteAddress)
+void NVMTarget_SendAddress(const uint32_t AbsoluteAddress)
{
/* Send the given 32-bit address to the target, LSB first */
PDITarget_SendByte(AbsoluteAddress & 0xFF);
@@ -95,7 +95,7 @@ bool NVMTarget_WaitWhileNVMControllerBusy(void) *
* \return Boolean true if the command sequence complete successfully
*/
-bool NVMTarget_GetMemoryCRC(uint8_t CRCCommand, uint32_t* CRCDest)
+bool NVMTarget_GetMemoryCRC(const uint8_t CRCCommand, uint32_t* const CRCDest)
{
/* Wait until the NVM controller is no longer busy */
if (!(NVMTarget_WaitWhileNVMControllerBusy()))
@@ -147,7 +147,7 @@ bool NVMTarget_GetMemoryCRC(uint8_t CRCCommand, uint32_t* CRCDest) *
* \return Boolean true if the command sequence complete successfully
*/
-bool NVMTarget_ReadMemory(uint32_t ReadAddress, uint8_t* ReadBuffer, uint16_t ReadSize)
+bool NVMTarget_ReadMemory(const uint32_t ReadAddress, uint8_t* ReadBuffer, const uint16_t ReadSize)
{
/* Wait until the NVM controller is no longer busy */
if (!(NVMTarget_WaitWhileNVMControllerBusy()))
@@ -182,7 +182,7 @@ bool NVMTarget_ReadMemory(uint32_t ReadAddress, uint8_t* ReadBuffer, uint16_t Re *
* \return Boolean true if the command sequence complete successfully
*/
-bool NVMTarget_WriteByteMemory(uint8_t WriteCommand, uint32_t WriteAddress, uint8_t* WriteBuffer)
+bool NVMTarget_WriteByteMemory(const uint8_t WriteCommand, const uint32_t WriteAddress, const uint8_t* WriteBuffer)
{
/* Wait until the NVM controller is no longer busy */
if (!(NVMTarget_WaitWhileNVMControllerBusy()))
@@ -195,7 +195,7 @@ bool NVMTarget_WriteByteMemory(uint8_t WriteCommand, uint32_t WriteAddress, uint /* Send new memory byte to the memory to the target */
PDITarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2));
- NVMTarget_SendAddress(WriteAddress++);
+ NVMTarget_SendAddress(WriteAddress);
PDITarget_SendByte(*(WriteBuffer++));
return true;
@@ -213,8 +213,9 @@ bool NVMTarget_WriteByteMemory(uint8_t WriteCommand, uint32_t WriteAddress, uint *
* \return Boolean true if the command sequence complete successfully
*/
-bool NVMTarget_WritePageMemory(uint8_t WriteBuffCommand, uint8_t EraseBuffCommand, uint8_t WritePageCommand,
- uint8_t PageMode, uint32_t WriteAddress, uint8_t* WriteBuffer, uint16_t WriteSize)
+bool NVMTarget_WritePageMemory(const uint8_t WriteBuffCommand, const uint8_t EraseBuffCommand,
+ const uint8_t WritePageCommand, const uint8_t PageMode, const uint32_t WriteAddress,
+ const uint8_t* WriteBuffer, const uint16_t WriteSize)
{
if (PageMode & XPRG_PAGEMODE_ERASE)
{
@@ -285,7 +286,7 @@ bool NVMTarget_WritePageMemory(uint8_t WriteBuffCommand, uint8_t EraseBuffComman *
* \return Boolean true if the command sequence complete successfully
*/
-bool NVMTarget_EraseMemory(uint8_t EraseCommand, uint32_t Address)
+bool NVMTarget_EraseMemory(const uint8_t EraseCommand, const uint32_t Address)
{
/* Wait until the NVM controller is no longer busy */
if (!(NVMTarget_WaitWhileNVMControllerBusy()))
diff --git a/Projects/AVRISP/Lib/NVMTarget.h b/Projects/AVRISP/Lib/NVMTarget.h index e9acd4375..24319331d 100644 --- a/Projects/AVRISP/Lib/NVMTarget.h +++ b/Projects/AVRISP/Lib/NVMTarget.h @@ -106,14 +106,15 @@ #define NVM_CMD_READEEPROM 0x06
/* Function Prototypes: */
- void NVMTarget_SendNVMRegAddress(uint8_t Register);
- void NVMTarget_SendAddress(uint32_t AbsoluteAddress);
+ void NVMTarget_SendNVMRegAddress(const uint8_t Register);
+ void NVMTarget_SendAddress(const uint32_t AbsoluteAddress);
bool NVMTarget_WaitWhileNVMControllerBusy(void);
- bool NVMTarget_GetMemoryCRC(uint8_t CRCCommand, uint32_t* CRCDest);
- bool NVMTarget_ReadMemory(uint32_t ReadAddress, uint8_t* ReadBuffer, uint16_t ReadSize);
- bool NVMTarget_WriteByteMemory(uint8_t WriteCommand, uint32_t WriteAddress, uint8_t* WriteBuffer);
- bool NVMTarget_WritePageMemory(uint8_t WriteBuffCommand, uint8_t EraseBuffCommand, uint8_t WritePageCommand,
- uint8_t PageMode, uint32_t WriteAddress, uint8_t* WriteBuffer, uint16_t WriteSize);
- bool NVMTarget_EraseMemory(uint8_t EraseCommand, uint32_t Address);
+ bool NVMTarget_GetMemoryCRC(const uint8_t CRCCommand, uint32_t* const CRCDest);
+ bool NVMTarget_ReadMemory(const uint32_t ReadAddress, uint8_t* ReadBuffer, const uint16_t ReadSize);
+ bool NVMTarget_WriteByteMemory(const uint8_t WriteCommand, const uint32_t WriteAddress, const uint8_t* WriteBuffer);
+ bool NVMTarget_WritePageMemory(const uint8_t WriteBuffCommand, const uint8_t EraseBuffCommand,
+ const uint8_t WritePageCommand, const uint8_t PageMode, const uint32_t WriteAddress,
+ const uint8_t* WriteBuffer, const uint16_t WriteSize);
+ bool NVMTarget_EraseMemory(const uint8_t EraseCommand, const uint32_t Address);
#endif
diff --git a/Projects/AVRISP/Lib/PDITarget.c b/Projects/AVRISP/Lib/PDITarget.c index afcf8b81f..df01497f6 100644 --- a/Projects/AVRISP/Lib/PDITarget.c +++ b/Projects/AVRISP/Lib/PDITarget.c @@ -167,7 +167,7 @@ void PDITarget_DisableTargetPDI(void) *
* \param[in] Byte Byte to send through the USART
*/
-void PDITarget_SendByte(uint8_t Byte)
+void PDITarget_SendByte(const uint8_t Byte)
{
#if defined(PDI_VIA_HARDWARE_USART)
/* Switch to Tx mode if currently in Rx mode */
diff --git a/Projects/AVRISP/Lib/PDITarget.h b/Projects/AVRISP/Lib/PDITarget.h index 03083fcb6..3758489a7 100644 --- a/Projects/AVRISP/Lib/PDITarget.h +++ b/Projects/AVRISP/Lib/PDITarget.h @@ -101,7 +101,7 @@ /* Function Prototypes: */
void PDITarget_EnableTargetPDI(void);
void PDITarget_DisableTargetPDI(void);
- void PDITarget_SendByte(uint8_t Byte);
+ void PDITarget_SendByte(const uint8_t Byte);
uint8_t PDITarget_ReceiveByte(void);
void PDITarget_SendBreak(void);
bool PDITarget_WaitWhileNVMBusBusy(void);
diff --git a/Projects/AVRISP/Lib/V2Protocol.c b/Projects/AVRISP/Lib/V2Protocol.c index dfb04c674..4bd1162a3 100644 --- a/Projects/AVRISP/Lib/V2Protocol.c +++ b/Projects/AVRISP/Lib/V2Protocol.c @@ -120,7 +120,7 @@ void V2Protocol_ProcessCommand(void) *
* \param[in] V2Command Issued V2 Protocol command byte from the host
*/
-static void V2Protocol_UnknownCommand(uint8_t V2Command)
+static void V2Protocol_UnknownCommand(const uint8_t V2Command)
{
/* Discard all incoming data */
while (Endpoint_BytesInEndpoint() == AVRISP_DATA_EPSIZE)
@@ -169,7 +169,7 @@ static void V2Protocol_ResetProtection(void) *
* \param[in] V2Command Issued V2 Protocol command byte from the host
*/
-static void V2Protocol_GetSetParam(uint8_t V2Command)
+static void V2Protocol_GetSetParam(const uint8_t V2Command)
{
uint8_t ParamID = Endpoint_Read_Byte();
uint8_t ParamValue;
diff --git a/Projects/AVRISP/Lib/V2ProtocolParams.c b/Projects/AVRISP/Lib/V2ProtocolParams.c index 91cccf48b..f900d7ecd 100644 --- a/Projects/AVRISP/Lib/V2ProtocolParams.c +++ b/Projects/AVRISP/Lib/V2ProtocolParams.c @@ -111,7 +111,7 @@ void V2Params_UpdateParamValues(void) *
* \return Privileges for the requested parameter, as a mask of PARAM_PRIV_* masks
*/
-uint8_t V2Params_GetParameterPrivileges(uint8_t ParamID)
+uint8_t V2Params_GetParameterPrivileges(const uint8_t ParamID)
{
ParameterItem_t* ParamInfo = V2Params_GetParamFromTable(ParamID);
@@ -127,7 +127,7 @@ uint8_t V2Params_GetParameterPrivileges(uint8_t ParamID) *
* \return Current value of the parameter in the table, or 0 if not found
*/
-uint8_t V2Params_GetParameterValue(uint8_t ParamID)
+uint8_t V2Params_GetParameterValue(const uint8_t ParamID)
{
ParameterItem_t* ParamInfo = V2Params_GetParamFromTable(ParamID);
@@ -144,7 +144,7 @@ uint8_t V2Params_GetParameterValue(uint8_t ParamID) *
* \return Pointer to the associated parameter information from the parameter table if found, NULL otherwise
*/
-void V2Params_SetParameterValue(uint8_t ParamID, uint8_t Value)
+void V2Params_SetParameterValue(const uint8_t ParamID, const uint8_t Value)
{
ParameterItem_t* ParamInfo = V2Params_GetParamFromTable(ParamID);
@@ -165,7 +165,7 @@ void V2Params_SetParameterValue(uint8_t ParamID, uint8_t Value) *
* \return Pointer to the associated parameter information from the parameter table if found, NULL otherwise
*/
-static ParameterItem_t* V2Params_GetParamFromTable(uint8_t ParamID)
+static ParameterItem_t* V2Params_GetParamFromTable(const uint8_t ParamID)
{
/* Find the parameter in the parameter table if present */
for (uint8_t TableIndex = 0; TableIndex < (sizeof(ParameterTable) / sizeof(ParameterTable[0])); TableIndex++)
diff --git a/Projects/AVRISP/Lib/V2ProtocolParams.h b/Projects/AVRISP/Lib/V2ProtocolParams.h index ca3dd9731..428c1d467 100644 --- a/Projects/AVRISP/Lib/V2ProtocolParams.h +++ b/Projects/AVRISP/Lib/V2ProtocolParams.h @@ -70,12 +70,12 @@ void V2Params_LoadNonVolatileParamValues(void);
void V2Params_UpdateParamValues(void);
- uint8_t V2Params_GetParameterPrivileges(uint8_t ParamID);
- uint8_t V2Params_GetParameterValue(uint8_t ParamID);
- void V2Params_SetParameterValue(uint8_t ParamID, uint8_t Value);
+ uint8_t V2Params_GetParameterPrivileges(const uint8_t ParamID);
+ uint8_t V2Params_GetParameterValue(const uint8_t ParamID);
+ void V2Params_SetParameterValue(const uint8_t ParamID, const uint8_t Value);
#if defined(INCLUDE_FROM_V2PROTOCOL_PARAMS_C)
- static ParameterItem_t* V2Params_GetParamFromTable(uint8_t ParamID);
+ static ParameterItem_t* V2Params_GetParamFromTable(const uint8_t ParamID);
#endif
#endif
diff --git a/Projects/Benito/Lib/RingBuff.c b/Projects/Benito/Lib/RingBuff.c index 0dd4a06bb..7b966ddb7 100644 --- a/Projects/Benito/Lib/RingBuff.c +++ b/Projects/Benito/Lib/RingBuff.c @@ -30,7 +30,7 @@ #include "RingBuff.h"
-void Buffer_Initialize(RingBuff_t* Buffer)
+void Buffer_Initialize(RingBuff_t* const Buffer)
{
BUFF_ATOMIC_BLOCK
{
@@ -40,7 +40,7 @@ void Buffer_Initialize(RingBuff_t* Buffer) }
}
-void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data)
+void Buffer_StoreElement(RingBuff_t* const Buffer, RingBuff_Data_t Data)
{
BUFF_ATOMIC_BLOCK
{
@@ -73,7 +73,7 @@ void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data) }
}
-RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer)
+RingBuff_Data_t Buffer_GetElement(RingBuff_t* const Buffer)
{
RingBuff_Data_t BuffData;
@@ -99,7 +99,7 @@ RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer) }
#if defined(BUFF_USEPEEK)
-RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* Buffer)
+RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* const Buffer)
{
RingBuff_Data_t BuffData;
diff --git a/Projects/Benito/Lib/RingBuff.h b/Projects/Benito/Lib/RingBuff.h index 23288d87a..705517a7a 100644 --- a/Projects/Benito/Lib/RingBuff.h +++ b/Projects/Benito/Lib/RingBuff.h @@ -106,11 +106,11 @@ } RingBuff_t;
/* Function Prototypes: */
- void Buffer_Initialize(RingBuff_t* Buff);
- void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data);
- RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer);
+ void Buffer_Initialize(RingBuff_t* const Buff);
+ void Buffer_StoreElement(RingBuff_t* const Buffer, RingBuff_Data_t Data);
+ RingBuff_Data_t Buffer_GetElement(RingBuff_t* const Buffer);
#if defined(BUFF_USEPEEK)
- RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* Buffer);
+ RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* const Buffer);
#endif
#endif
diff --git a/Projects/Magstripe/Lib/CircularBitBuffer.c b/Projects/Magstripe/Lib/CircularBitBuffer.c index 5d23762ec..4e0cc4da3 100644 --- a/Projects/Magstripe/Lib/CircularBitBuffer.c +++ b/Projects/Magstripe/Lib/CircularBitBuffer.c @@ -37,7 +37,7 @@ #include "CircularBitBuffer.h"
/** Function to initialize or reset a bit buffer, ready for data to be stored into it. */
-void BitBuffer_Init(BitBuffer_t* Buffer)
+void BitBuffer_Init(BitBuffer_t* const Buffer)
{
/* Reset the number of stored bits in the buffer */
Buffer->Elements = 0;
@@ -50,7 +50,7 @@ void BitBuffer_Init(BitBuffer_t* Buffer) }
/** Function to store the given bit into the given bit buffer. */
-void BitBuffer_StoreNextBit(BitBuffer_t* Buffer, bool Bit)
+void BitBuffer_StoreNextBit(BitBuffer_t* const Buffer, const bool Bit)
{
/* If the bit to store is true, set the next bit in the buffer */
if (Bit)
@@ -79,7 +79,7 @@ void BitBuffer_StoreNextBit(BitBuffer_t* Buffer, bool Bit) }
/** Function to retrieve the next bit stored in the given bit buffer. */
-bool BitBuffer_GetNextBit(BitBuffer_t* Buffer)
+bool BitBuffer_GetNextBit(BitBuffer_t* const Buffer)
{
/* Retrieve the value of the next bit stored in the buffer */
bool Bit = ((*Buffer->Out.CurrentByte & Buffer->Out.ByteMask) != 0);
diff --git a/Projects/Magstripe/Lib/CircularBitBuffer.h b/Projects/Magstripe/Lib/CircularBitBuffer.h index 6220e1b90..c5d1c1a20 100644 --- a/Projects/Magstripe/Lib/CircularBitBuffer.h +++ b/Projects/Magstripe/Lib/CircularBitBuffer.h @@ -75,14 +75,14 @@ *
* \param[in,out] Buffer Bit buffer to initialize
*/
- void BitBuffer_Init(BitBuffer_t* Buffer) ATTR_NON_NULL_PTR_ARG(1);
+ void BitBuffer_Init(BitBuffer_t* const Buffer) ATTR_NON_NULL_PTR_ARG(1);
/** Stores a bit into the next location inside a given bit buffer.
*
* \param[in,out] Buffer Bit buffer to store a bit into
* \param[in] Bit Bit to store into the buffer
*/
- void BitBuffer_StoreNextBit(BitBuffer_t* Buffer, bool Bit) ATTR_NON_NULL_PTR_ARG(1);
+ void BitBuffer_StoreNextBit(BitBuffer_t* const Buffer, const bool Bit) ATTR_NON_NULL_PTR_ARG(1);
/** Retrieves a bit from the next location inside a given bit buffer.
*
@@ -90,6 +90,6 @@ *
* \return Next bit from the buffer
*/
- bool BitBuffer_GetNextBit(BitBuffer_t* Buffer) ATTR_NON_NULL_PTR_ARG(1);
+ bool BitBuffer_GetNextBit(BitBuffer_t* const Buffer) ATTR_NON_NULL_PTR_ARG(1);
#endif
diff --git a/Projects/USBtoSerial/Lib/RingBuff.c b/Projects/USBtoSerial/Lib/RingBuff.c index 0dd4a06bb..7b966ddb7 100644 --- a/Projects/USBtoSerial/Lib/RingBuff.c +++ b/Projects/USBtoSerial/Lib/RingBuff.c @@ -30,7 +30,7 @@ #include "RingBuff.h"
-void Buffer_Initialize(RingBuff_t* Buffer)
+void Buffer_Initialize(RingBuff_t* const Buffer)
{
BUFF_ATOMIC_BLOCK
{
@@ -40,7 +40,7 @@ void Buffer_Initialize(RingBuff_t* Buffer) }
}
-void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data)
+void Buffer_StoreElement(RingBuff_t* const Buffer, RingBuff_Data_t Data)
{
BUFF_ATOMIC_BLOCK
{
@@ -73,7 +73,7 @@ void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data) }
}
-RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer)
+RingBuff_Data_t Buffer_GetElement(RingBuff_t* const Buffer)
{
RingBuff_Data_t BuffData;
@@ -99,7 +99,7 @@ RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer) }
#if defined(BUFF_USEPEEK)
-RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* Buffer)
+RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* const Buffer)
{
RingBuff_Data_t BuffData;
diff --git a/Projects/USBtoSerial/Lib/RingBuff.h b/Projects/USBtoSerial/Lib/RingBuff.h index 23288d87a..705517a7a 100644 --- a/Projects/USBtoSerial/Lib/RingBuff.h +++ b/Projects/USBtoSerial/Lib/RingBuff.h @@ -106,11 +106,11 @@ } RingBuff_t;
/* Function Prototypes: */
- void Buffer_Initialize(RingBuff_t* Buff);
- void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data);
- RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer);
+ void Buffer_Initialize(RingBuff_t* const Buff);
+ void Buffer_StoreElement(RingBuff_t* const Buffer, RingBuff_Data_t Data);
+ RingBuff_Data_t Buffer_GetElement(RingBuff_t* const Buffer);
#if defined(BUFF_USEPEEK)
- RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* Buffer);
+ RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* const Buffer);
#endif
#endif
diff --git a/Projects/XPLAINBridge/Lib/RingBuff.c b/Projects/XPLAINBridge/Lib/RingBuff.c index 0dd4a06bb..7b966ddb7 100644 --- a/Projects/XPLAINBridge/Lib/RingBuff.c +++ b/Projects/XPLAINBridge/Lib/RingBuff.c @@ -30,7 +30,7 @@ #include "RingBuff.h"
-void Buffer_Initialize(RingBuff_t* Buffer)
+void Buffer_Initialize(RingBuff_t* const Buffer)
{
BUFF_ATOMIC_BLOCK
{
@@ -40,7 +40,7 @@ void Buffer_Initialize(RingBuff_t* Buffer) }
}
-void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data)
+void Buffer_StoreElement(RingBuff_t* const Buffer, RingBuff_Data_t Data)
{
BUFF_ATOMIC_BLOCK
{
@@ -73,7 +73,7 @@ void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data) }
}
-RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer)
+RingBuff_Data_t Buffer_GetElement(RingBuff_t* const Buffer)
{
RingBuff_Data_t BuffData;
@@ -99,7 +99,7 @@ RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer) }
#if defined(BUFF_USEPEEK)
-RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* Buffer)
+RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* const Buffer)
{
RingBuff_Data_t BuffData;
diff --git a/Projects/XPLAINBridge/Lib/RingBuff.h b/Projects/XPLAINBridge/Lib/RingBuff.h index 23288d87a..705517a7a 100644 --- a/Projects/XPLAINBridge/Lib/RingBuff.h +++ b/Projects/XPLAINBridge/Lib/RingBuff.h @@ -106,11 +106,11 @@ } RingBuff_t;
/* Function Prototypes: */
- void Buffer_Initialize(RingBuff_t* Buff);
- void Buffer_StoreElement(RingBuff_t* Buffer, RingBuff_Data_t Data);
- RingBuff_Data_t Buffer_GetElement(RingBuff_t* Buffer);
+ void Buffer_Initialize(RingBuff_t* const Buff);
+ void Buffer_StoreElement(RingBuff_t* const Buffer, RingBuff_Data_t Data);
+ RingBuff_Data_t Buffer_GetElement(RingBuff_t* const Buffer);
#if defined(BUFF_USEPEEK)
- RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* Buffer);
+ RingBuff_Data_t Buffer_PeekElement(const RingBuff_t* const Buffer);
#endif
#endif
|