projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The incomplete StandaloneProgrammer project now uses Host and Device Mass storage...
[pub/USBasp.git]
/
Projects
/
AVRISP
/
Lib
/
V2Protocol.c
diff --git
a/Projects/AVRISP/Lib/V2Protocol.c
b/Projects/AVRISP/Lib/V2Protocol.c
index
6099234
..
d03bd89
100644
(file)
--- a/
Projects/AVRISP/Lib/V2Protocol.c
+++ b/
Projects/AVRISP/Lib/V2Protocol.c
@@
-36,12
+36,12
@@
#define INCLUDE_FROM_V2PROTOCOL_C
\r
#include "V2Protocol.h"
\r
\r
#define INCLUDE_FROM_V2PROTOCOL_C
\r
#include "V2Protocol.h"
\r
\r
-/** Master V2 Protocol packet handler, for recei
e
ved V2 Protocol packets from a connected host.
\r
+/** Master V2 Protocol packet handler, for received V2 Protocol packets from a connected host.
\r
* This routine decodes the issued command and passes off the handling of the command to the
\r
* appropriate function.
\r
*/
\r
* This routine decodes the issued command and passes off the handling of the command to the
\r
* appropriate function.
\r
*/
\r
-void V2Protocol_ProcessCommand(void)
-{
+void V2Protocol_ProcessCommand(void)
\r
+{
\r
uint8_t V2Command = Endpoint_Read_Byte();
\r
\r
switch (V2Command)
\r
uint8_t V2Command = Endpoint_Read_Byte();
\r
\r
switch (V2Command)
\r
@@
-95,8
+95,8
@@
void V2Protocol_ProcessCommand(void)
}
\r
\r
Endpoint_WaitUntilReady();
\r
}
\r
\r
Endpoint_WaitUntilReady();
\r
- Endpoint_SetEndpointDirection(ENDPOINT_DIR_OUT);
-}
+ Endpoint_SetEndpointDirection(ENDPOINT_DIR_OUT);
\r
+}
\r
\r
/** Handler for unknown V2 protocol commands. This discards all sent data and returns a
\r
* STATUS_CMD_UNKNOWN status back to the host.
\r
\r
/** Handler for unknown V2 protocol commands. This discards all sent data and returns a
\r
* STATUS_CMD_UNKNOWN status back to the host.
\r
@@
-105,7
+105,7
@@
void V2Protocol_ProcessCommand(void)
*/
\r
static void V2Protocol_Command_Unknown(uint8_t V2Command)
\r
{
\r
*/
\r
static void V2Protocol_Command_Unknown(uint8_t V2Command)
\r
{
\r
- /* Discard all incom
m
ing data */
\r
+ /* Discard all incoming data */
\r
while (Endpoint_BytesInEndpoint() == AVRISP_DATA_EPSIZE)
\r
{
\r
Endpoint_ClearOUT();
\r
while (Endpoint_BytesInEndpoint() == AVRISP_DATA_EPSIZE)
\r
{
\r
Endpoint_ClearOUT();
\r
@@
-120,7
+120,7
@@
static void V2Protocol_Command_Unknown(uint8_t V2Command)
Endpoint_ClearIN();
\r
}
\r
\r
Endpoint_ClearIN();
\r
}
\r
\r
-/** Handler for the CMD_SIGN_ON command, returning the programmer ID string to the host. */
+/** Handler for the CMD_SIGN_ON command, returning the programmer ID string to the host. */
\r
static void V2Protocol_Command_SignOn(void)
\r
{
\r
Endpoint_ClearOUT();
\r
static void V2Protocol_Command_SignOn(void)
\r
{
\r
Endpoint_ClearOUT();
\r
@@
-151,7
+151,7
@@
static void V2Protocol_Command_GetSetParam(uint8_t V2Command)
\r
Endpoint_Write_Byte(V2Command);
\r
\r
\r
Endpoint_Write_Byte(V2Command);
\r
\r
- uint8_t ParamPrivs = V2Params_GetParameterPriv
ella
ges(ParamID);
\r
+ uint8_t ParamPrivs = V2Params_GetParameterPriv
ile
ges(ParamID);
\r
\r
if ((V2Command == CMD_SET_PARAMETER) && (ParamPrivs & PARAM_PRIV_WRITE))
\r
{
\r
\r
if ((V2Command == CMD_SET_PARAMETER) && (ParamPrivs & PARAM_PRIV_WRITE))
\r
{
\r
@@
-301,11
+301,9
@@
static void V2Protocol_Command_ProgramMemory(uint8_t V2Command)
uint8_t ProgrammingCommands[3];
\r
uint8_t PollValue1;
\r
uint8_t PollValue2;
\r
uint8_t ProgrammingCommands[3];
\r
uint8_t PollValue1;
\r
uint8_t PollValue2;
\r
- uint8_t ProgData[256];
\r
- } Write_Memory_Params;
\r
+ uint8_t ProgData[256];
// Note, the Jungo driver has a very short ACK timeout period, need to buffer the
\r
+ } Write_Memory_Params;
// whole page and ACK the packet as fast as possible to prevent it from aborting
\r
\r
\r
- uint8_t* NextWriteByte = Write_Memory_Params.ProgData;
\r
-
\r
Endpoint_Read_Stream_LE(&Write_Memory_Params, sizeof(Write_Memory_Params) - sizeof(Write_Memory_Params.ProgData));
\r
Write_Memory_Params.BytesToWrite = SwapEndian_16(Write_Memory_Params.BytesToWrite);
\r
\r
Endpoint_Read_Stream_LE(&Write_Memory_Params, sizeof(Write_Memory_Params) - sizeof(Write_Memory_Params.ProgData));
\r
Write_Memory_Params.BytesToWrite = SwapEndian_16(Write_Memory_Params.BytesToWrite);
\r
\r
@@
-329,6
+327,8
@@
static void V2Protocol_Command_ProgramMemory(uint8_t V2Command)
uint16_t PollAddress = 0;
\r
uint8_t PollValue = (V2Command == CMD_PROGRAM_FLASH_ISP) ? Write_Memory_Params.PollValue1 :
\r
Write_Memory_Params.PollValue2;
\r
uint16_t PollAddress = 0;
\r
uint8_t PollValue = (V2Command == CMD_PROGRAM_FLASH_ISP) ? Write_Memory_Params.PollValue1 :
\r
Write_Memory_Params.PollValue2;
\r
+ uint8_t* NextWriteByte = Write_Memory_Params.ProgData;
\r
+
\r
if (Write_Memory_Params.ProgrammingMode & PROG_MODE_PAGED_WRITES_MASK)
\r
{
\r
uint16_t StartAddress = (CurrentAddress & 0xFFFF);
\r
if (Write_Memory_Params.ProgrammingMode & PROG_MODE_PAGED_WRITES_MASK)
\r
{
\r
uint16_t StartAddress = (CurrentAddress & 0xFFFF);
\r