* - Slowed down bit-banged PDI programming in the AVRISP project slightly to prevent transmission errors\r
*\r
* <b>Fixed:</b>\r
+ * - Fixed AVRISP project not able to enter programming mode when ISP protocol is used\r
*\r
* \section Sec_ChangeLog091223 Version 091223\r
*\r
\r
/* Includes: */\r
#include <avr/io.h>\r
+ #include <util/delay.h>\r
\r
#include <LUFA/Drivers/USB/USB.h>\r
\r
#define PROG_MODE_COMMIT_PAGE_MASK (1 << 7)\r
\r
/* Inline Functions: */\r
- /** Blocking delay for a given number of milliseconds, via a hardware timer.\r
+ /** Blocking delay for a given number of milliseconds.\r
*\r
* \param[in] DelayMS Number of milliseconds to delay for\r
*/\r
static inline void ISPProtocol_DelayMS(uint8_t DelayMS)\r
{\r
- OCR2A = ((F_CPU / 64) / 1000);\r
- TCCR2A = (1 << WGM01);\r
- TCCR2B = ((1 << CS01) | (1 << CS00)); \r
-\r
- while (DelayMS)\r
- {\r
- if (TIFR2 & (1 << OCF2A))\r
- {\r
- TIFR2 = (1 << OCF2A);\r
- DelayMS--;\r
- }\r
- }\r
- \r
- TCCR2B = 0; \r
+ while (DelayMS--)\r
+ _delay_ms(1);\r
}\r
\r
/* Function Prototypes: */\r
break;\r
case PROG_MODE_WORD_VALUE_MASK:\r
case PROG_MODE_PAGED_VALUE_MASK:\r
+ TCNT0 = 0;\r
+ TIFR0 = (1 << OCF1A);\r
+ \r
do\r
{\r
SPI_SendByte(ReadMemCommand);\r
{\r
ParameterItem_t* ParamInfo = V2Params_GetParamFromTable(ParamID);\r
\r
- if ((ParamInfo == NULL) || !(ParamInfo->ParamPrivileges & PARAM_PRIV_READ))\r
+ if (ParamInfo == NULL)\r
return 0;\r
\r
return ParamInfo->ParamValue;\r
{\r
ParameterItem_t* ParamInfo = V2Params_GetParamFromTable(ParamID);\r
\r
- if ((ParamInfo == NULL) || !(ParamInfo->ParamPrivileges & PARAM_PRIV_WRITE))\r
+ if (ParamInfo == NULL)\r
return;\r
\r
ParamInfo->ParamValue = Value;\r
*/\r
static ParameterItem_t* V2Params_GetParamFromTable(const uint8_t ParamID)\r
{\r
+ ParameterItem_t* CurrTableItem = ParameterTable;\r
+\r
/* Find the parameter in the parameter table if present */\r
for (uint8_t TableIndex = 0; TableIndex < (sizeof(ParameterTable) / sizeof(ParameterTable[0])); TableIndex++)\r
{\r
- if (ParamID == ParameterTable[TableIndex].ParamID)\r
- return &ParameterTable[TableIndex];\r
+ if (ParamID == CurrTableItem->ParamID)\r
+ return CurrTableItem;\r
+ \r
+ CurrTableItem++;\r
}\r
\r
return NULL;\r
\r
\r
# MCU name\r
-MCU = at90usb1287\r
+MCU = at90usb162\r
\r
\r
# Target board (see library "Board Types" documentation, USER or blank for projects not requiring\r