Added V2 protocol handlers for the READ and WRITE memory commands in the AVRISP proje...
[pub/USBasp.git] / Projects / Incomplete / AVRISP / Lib / V2ProtocolTarget.c
index 7bcf0be..15ac3e5 100644 (file)
 #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