diff options
Diffstat (limited to 'Projects/AVRISP')
-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 |
10 files changed, 42 insertions, 39 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
|