#include "V2ProtocolTarget.h"\r
\r
/** Current memory address for FLASH/EEPROM memory read/write commands */\r
-uint32_t CurrentAddress;\r
+uint32_t CurrentAddress; \r
\r
-/** Table of masks for SPI_Init() from a given PARAM_SCK_DURATION value */\r
-static const uint8_t SPIMaskFromSCKDuration[] =\r
+uint8_t V2Protocol_GetSPIPrescalerMask(void)\r
+{\r
+ static const uint8_t SPIMaskFromSCKDuration[] =\r
{\r
#if (F_CPU == 8000000)\r
SPI_SPEED_FCPU_DIV_2,\r
#endif\r
SPI_SPEED_FCPU_DIV_2, SPI_SPEED_FCPU_DIV_4, SPI_SPEED_FCPU_DIV_8,\r
SPI_SPEED_FCPU_DIV_16, SPI_SPEED_FCPU_DIV_32, SPI_SPEED_FCPU_DIV_64\r
- #if (F_CPU == 16000000) \r
+ #if (F_CPU == 16000000)\r
, SPI_SPEED_FCPU_DIV_128\r
#endif\r
};\r
- \r
\r
-uint8_t V2Protocol_GetSPIPrescalerMask(void)\r
-{\r
uint8_t SCKDuration = V2Params_GetParameterValue(PARAM_SCK_DURATION);\r
\r
if (SCKDuration >= sizeof(SPIMaskFromSCKDuration))\r
}\r
else\r
{\r
- RESET_LINE_PORT &= ~RESET_LINE_MASK; \r
+ RESET_LINE_PORT &= ~RESET_LINE_MASK;\r
RESET_LINE_DDR &= ~RESET_LINE_MASK;\r
}\r
}\r
\r
do\r
{\r
- V2Protocol_DelayMS(1);\r
- \r
SPI_SendByte(0xF0);\r
SPI_SendByte(0x00);\r
\r
SPI_SendByte(0x00);\r
ResponseByte = SPI_ReceiveByte();\r
+\r
+ V2Protocol_DelayMS(1);\r
}\r
while ((ResponseByte & 0x01) && (TimeoutMS--));\r
\r