Combine AVRISP project TPI and PDI lib directories - these protocols use the same underlying XPROG wrapper for the host-to-programmer command wrapping.
This commit is contained in:
parent
26bc1f3cfd
commit
ce044844ea
20 changed files with 19 additions and 11 deletions
|
|
@ -50,7 +50,9 @@ bool MustSetAddress;
|
|||
void V2Protocol_ProcessCommand(void)
|
||||
{
|
||||
uint8_t V2Command = Endpoint_Read_Byte();
|
||||
|
||||
|
||||
Serial_TxByte(V2Command);
|
||||
|
||||
switch (V2Command)
|
||||
{
|
||||
case CMD_SIGN_ON:
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
/* Includes: */
|
||||
#include <LUFA/Drivers/USB/USB.h>
|
||||
#include <LUFA/Drivers/Peripheral/SPI.h>
|
||||
#include <LUFA/Drivers/Peripheral/Serial.h>
|
||||
|
||||
#include "../Descriptors.h"
|
||||
#include "V2ProtocolConstants.h"
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ void PDIProtocol_XPROG_SetMode(void)
|
|||
Endpoint_ClearOUT();
|
||||
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
|
||||
|
||||
Serial_TxByte(SetMode_XPROG_Params.Protocol);
|
||||
|
||||
Endpoint_Write_Byte(CMD_XPROG_SETMODE);
|
||||
Endpoint_Write_Byte((SetMode_XPROG_Params.Protocol == XPRG_PROTOCOL_PDI) ? STATUS_CMD_OK : STATUS_CMD_FAILED);
|
||||
Endpoint_ClearIN();
|
||||
|
|
@ -100,6 +100,7 @@
|
|||
|
||||
#define XPRG_PROTOCOL_PDI 0x00
|
||||
#define XPRG_PROTOCOL_JTAG 0x01
|
||||
#define XPRG_PROTOCOL_TPI 0x02
|
||||
|
||||
#define XPRG_PAGEMODE_WRITE (1 << 1)
|
||||
#define XPRG_PAGEMODE_ERASE (1 << 0)
|
||||
|
|
@ -320,7 +320,7 @@ bool TPITarget_WaitWhileNVMBusBusy(void)
|
|||
/* Poll the STATUS register to check to see if NVM access has been enabled */
|
||||
while (TimeoutMS)
|
||||
{
|
||||
/* Send the LDCS command to read the TPI STATUS register to see the NVM bus is active */
|
||||
/* Send the SLDCS command to read the TPI STATUS register to see the NVM bus is active */
|
||||
TPITarget_SendByte(TPI_CMD_SLDCS | TPI_STATUS_REG);
|
||||
if (TPITarget_ReceiveByte() & TPI_STATUS_NVM)
|
||||
return true;
|
||||
Loading…
Add table
Add a link
Reference in a new issue