aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-08-23 12:38:50 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-08-23 12:38:50 +0000
commitdbb5f249bd057c7b292645463c52067c1da58efa (patch)
treea80b8679ef3f5de31cf7eee3a12d76d7e284119b /Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c
parent7e74bd3ea2f8de6c6a78fc8e2527c806b2dd8476 (diff)
downloadlufa-dbb5f249bd057c7b292645463c52067c1da58efa.tar.gz
lufa-dbb5f249bd057c7b292645463c52067c1da58efa.tar.bz2
lufa-dbb5f249bd057c7b292645463c52067c1da58efa.zip
Added V2 protocol handlers for the READ and WRITE memory commands in the AVRISP project. Finished READ command handler, skeleton WRITE handler implemented.
Diffstat (limited to 'Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c')
-rw-r--r--Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c b/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c
index 7bcf0bea4..15ac3e5b4 100644
--- a/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c
+++ b/Projects/Incomplete/AVRISP/Lib/V2ProtocolTarget.c
@@ -36,24 +36,22 @@
#include "V2ProtocolTarget.h"
/** Current memory address for FLASH/EEPROM memory read/write commands */
-uint32_t CurrentAddress;
+uint32_t CurrentAddress;
-/** Table of masks for SPI_Init() from a given PARAM_SCK_DURATION value */
-static const uint8_t SPIMaskFromSCKDuration[] =
+uint8_t V2Protocol_GetSPIPrescalerMask(void)
+{
+ static const uint8_t SPIMaskFromSCKDuration[] =
{
#if (F_CPU == 8000000)
SPI_SPEED_FCPU_DIV_2,
#endif
SPI_SPEED_FCPU_DIV_2, SPI_SPEED_FCPU_DIV_4, SPI_SPEED_FCPU_DIV_8,
SPI_SPEED_FCPU_DIV_16, SPI_SPEED_FCPU_DIV_32, SPI_SPEED_FCPU_DIV_64
- #if (F_CPU == 16000000)
+ #if (F_CPU == 16000000)
, SPI_SPEED_FCPU_DIV_128
#endif
};
-
-uint8_t V2Protocol_GetSPIPrescalerMask(void)
-{
uint8_t SCKDuration = V2Params_GetParameterValue(PARAM_SCK_DURATION);
if (SCKDuration >= sizeof(SPIMaskFromSCKDuration))