projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d1608d4
)
Fixed ISP mode in the AVRISP programmer project.
author
Dean Camera
<dean@fourwalledcubicle.com>
Sat, 26 Dec 2009 05:20:10 +0000
(
05:20
+0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Sat, 26 Dec 2009 05:20:10 +0000
(
05:20
+0000)
LUFA/ManPages/ChangeLog.txt
patch
|
blob
|
blame
|
history
Projects/AVRISP/Lib/ISP/ISPProtocol.h
patch
|
blob
|
blame
|
history
Projects/AVRISP/Lib/ISP/ISPTarget.c
patch
|
blob
|
blame
|
history
Projects/AVRISP/Lib/V2ProtocolParams.c
patch
|
blob
|
blame
|
history
Projects/AVRISP/makefile
patch
|
blob
|
blame
|
history
diff --git
a/LUFA/ManPages/ChangeLog.txt
b/LUFA/ManPages/ChangeLog.txt
index
48361e3
..
41e82ea
100644
(file)
--- a/
LUFA/ManPages/ChangeLog.txt
+++ b/
LUFA/ManPages/ChangeLog.txt
@@
-17,6
+17,7
@@
* - Slowed down bit-banged PDI programming in the AVRISP project slightly to prevent transmission errors
\r
*
\r
* <b>Fixed:</b>
\r
* - 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
* \section Sec_ChangeLog091223 Version 091223
\r
*
\r
diff --git
a/Projects/AVRISP/Lib/ISP/ISPProtocol.h
b/Projects/AVRISP/Lib/ISP/ISPProtocol.h
index
abbbf56
..
127c826
100644
(file)
--- a/
Projects/AVRISP/Lib/ISP/ISPProtocol.h
+++ b/
Projects/AVRISP/Lib/ISP/ISPProtocol.h
@@
-38,6
+38,7
@@
\r
/* Includes: */
\r
#include <avr/io.h>
\r
\r
/* Includes: */
\r
#include <avr/io.h>
\r
+ #include <util/delay.h>
\r
\r
#include <LUFA/Drivers/USB/USB.h>
\r
\r
\r
#include <LUFA/Drivers/USB/USB.h>
\r
\r
@@
-66,26
+67,14
@@
#define PROG_MODE_COMMIT_PAGE_MASK (1 << 7)
\r
\r
/* Inline Functions: */
\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
*
\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
}
\r
\r
/* Function Prototypes: */
\r
diff --git
a/Projects/AVRISP/Lib/ISP/ISPTarget.c
b/Projects/AVRISP/Lib/ISP/ISPTarget.c
index
29cb18e
..
a3a8b22
100644
(file)
--- a/
Projects/AVRISP/Lib/ISP/ISPTarget.c
+++ b/
Projects/AVRISP/Lib/ISP/ISPTarget.c
@@
-122,6
+122,9
@@
uint8_t ISPTarget_WaitForProgComplete(const uint8_t ProgrammingMode, const uint1
break;
\r
case PROG_MODE_WORD_VALUE_MASK:
\r
case PROG_MODE_PAGED_VALUE_MASK:
\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
do
\r
{
\r
SPI_SendByte(ReadMemCommand);
\r
diff --git
a/Projects/AVRISP/Lib/V2ProtocolParams.c
b/Projects/AVRISP/Lib/V2ProtocolParams.c
index
eacff03
..
1056335
100644
(file)
--- a/
Projects/AVRISP/Lib/V2ProtocolParams.c
+++ b/
Projects/AVRISP/Lib/V2ProtocolParams.c
@@
-131,7
+131,7
@@
uint8_t V2Params_GetParameterValue(const uint8_t ParamID)
{
\r
ParameterItem_t* ParamInfo = V2Params_GetParamFromTable(ParamID);
\r
\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
return 0;
\r
\r
return ParamInfo->ParamValue;
\r
@@
-148,7
+148,7
@@
void V2Params_SetParameterValue(const uint8_t ParamID, const uint8_t Value)
{
\r
ParameterItem_t* ParamInfo = V2Params_GetParamFromTable(ParamID);
\r
\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
return;
\r
\r
ParamInfo->ParamValue = Value;
\r
@@
-167,11
+167,15
@@
void V2Params_SetParameterValue(const uint8_t ParamID, const uint8_t Value)
*/
\r
static ParameterItem_t* V2Params_GetParamFromTable(const uint8_t ParamID)
\r
{
\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
/* 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
return NULL;
\r
diff --git
a/Projects/AVRISP/makefile
b/Projects/AVRISP/makefile
index
f5bb5b7
..
823535f
100644
(file)
--- a/
Projects/AVRISP/makefile
+++ b/
Projects/AVRISP/makefile
@@
-60,7
+60,7
@@
\r
\r
# MCU name
\r
\r
\r
# MCU name
\r
-MCU = at90usb1
287
\r
+MCU = at90usb1
62
\r
\r
\r
# Target board (see library "Board Types" documentation, USER or blank for projects not requiring
\r
\r
\r
# Target board (see library "Board Types" documentation, USER or blank for projects not requiring
\r