Rename PDIProtocol.c/.h to XPROGProtocol.c/.h as it will now handle both TPI and...
[pub/USBasp.git] / Projects / AVRISP / Lib / V2Protocol.h
index 1777e0f..8cc4c3c 100644 (file)
        /* Includes: */
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Peripheral/SPI.h>\r
+               #include <LUFA/Drivers/Peripheral/Serial.h>\r
                \r
                #include "../Descriptors.h"
                #include "V2ProtocolConstants.h"\r
                #include "V2ProtocolParams.h"
-               #include "ISPProtocol.h"\r
-               #include "PDIProtocol.h"\r
+               #include "ISP/ISPProtocol.h"\r
+               #include "XPROG/XPROGProtocol.h"\r
 \r
        /* Preprocessor Checks: */\r
                #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))\r
                        #undef ENABLE_ISP_PROTOCOL\r
+                       #undef ENABLE_TPI_PROTOCOL\r
                        \r
                        #if !defined(ENABLE_PDI_PROTOCOL)\r
                                #define ENABLE_PDI_PROTOCOL\r
 
        /* Macros: */\r
                /** Programmer ID string, returned to the host during the CMD_SIGN_ON command processing */
-               #define PROGRAMMER_ID             "AVRISP_MK2"\r
-\r
-               /** Timeout in milliseconds of target busy-wait loops waiting for a command to complete */\r
-               #define TARGET_BUSY_TIMEOUT_MS    240\r
-\r
-       /* Inline Functions: */\r
-               /** Blocking delay for a given number of milliseconds, via a hardware timer.\r
-                *\r
-                *  \param[in] DelayMS  Number of milliseconds to delay for\r
-                */\r
-               static inline void V2Protocol_DelayMS(uint8_t DelayMS)\r
-               {\r
-                       TCNT0 = 0;\r
-                       TIFR0 = (1 << OCF1A);\r
-\r
-                       while (DelayMS)\r
-                       {\r
-                               if (TIFR0 & (1 << OCF1A))\r
-                               {\r
-                                       TIFR0 = (1 << OCF1A);\r
-                                       DelayMS--;\r
-                               }\r
-                       }\r
-               }
+               #define PROGRAMMER_ID     "AVRISP_MK2"\r
 \r
        /* External Variables: */\r
                extern uint32_t CurrentAddress;\r
-               extern bool MustSetAddress;\r
+               extern bool     MustSetAddress;\r
 \r
        /* Function Prototypes: */\r
                void V2Protocol_ProcessCommand(void);\r