Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
872f61ff
Commit
872f61ff
authored
Jan 29, 2010
by
Dean Camera
Browse files
Fix TPI communications in the AVRISP project when bit-banged USART mode is selected.
parent
fa3135d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
View file @
872f61ff
...
...
@@ -116,7 +116,7 @@ bool TINYNVM_WaitWhileNVMControllerBusy(void)
*
* \return Boolean true if the command sequence complete successfully
*/
bool
TINYNVM_ReadMemory
(
const
uint
32
_t
ReadAddress
,
uint8_t
*
ReadBuffer
,
uint16_t
ReadSize
)
bool
TINYNVM_ReadMemory
(
const
uint
16
_t
ReadAddress
,
uint8_t
*
ReadBuffer
,
uint16_t
ReadSize
)
{
/* Wait until the NVM controller is no longer busy */
if
(
!
(
TINYNVM_WaitWhileNVMControllerBusy
()))
...
...
@@ -147,7 +147,7 @@ bool TINYNVM_ReadMemory(const uint32_t ReadAddress, uint8_t* ReadBuffer, uint16_
*
* \return Boolean true if the command sequence complete successfully
*/
bool
TINYNVM_WriteMemory
(
const
uint
32
_t
WriteAddress
,
const
uint8_t
*
WriteBuffer
,
uint16_t
WriteLength
)
bool
TINYNVM_WriteMemory
(
const
uint
16
_t
WriteAddress
,
const
uint8_t
*
WriteBuffer
,
uint16_t
WriteLength
)
{
/* Wait until the NVM controller is no longer busy */
if
(
!
(
TINYNVM_WaitWhileNVMControllerBusy
()))
...
...
Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.h
View file @
872f61ff
...
...
@@ -63,8 +63,8 @@
/* Function Prototypes: */
bool
TINYNVM_WaitWhileNVMBusBusy
(
void
);
bool
TINYNVM_ReadMemory
(
const
uint
32
_t
ReadAddress
,
uint8_t
*
ReadBuffer
,
uint16_t
ReadLength
);
bool
TINYNVM_WriteMemory
(
const
uint
32
_t
WriteAddress
,
const
uint8_t
*
WriteBuffer
,
uint16_t
WriteLength
);
bool
TINYNVM_ReadMemory
(
const
uint
16
_t
ReadAddress
,
uint8_t
*
ReadBuffer
,
uint16_t
ReadLength
);
bool
TINYNVM_WriteMemory
(
const
uint
16
_t
WriteAddress
,
const
uint8_t
*
WriteBuffer
,
uint16_t
WriteLength
);
bool
TINYNVM_EraseMemory
(
void
);
#if defined(INCLUDE_FROM_TINYNVM_C)
...
...
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
View file @
872f61ff
...
...
@@ -96,7 +96,7 @@ ISR(TIMER1_COMPA_vect, ISR_BLOCK)
}
/** ISR to manage the TPI software USART when bit-banged TPI USART mode is selected. */
ISR
(
TIMER1_C
OMPB
_vect
,
ISR_BLOCK
)
ISR
(
TIMER1_C
APT
_vect
,
ISR_BLOCK
)
{
/* Toggle CLOCK pin in a single cycle (see AVR datasheet) */
BITBANG_TPICLOCK_PIN
|=
BITBANG_TPICLOCK_MASK
;
...
...
@@ -209,10 +209,10 @@ void XPROGTarget_EnableTargetTPI(void)
/* Set DATA line high for idle state */
BITBANG_TPIDATA_PORT
|=
BITBANG_TPIDATA_MASK
;
/* Fire timer capture channel
B
ISR to manage the software USART */
O
CR1
B
=
BITS_BETWEEN_USART_CLOCKS
;
TCCR1B
=
(
1
<<
WGM12
)
|
(
1
<<
CS10
);
TIMSK1
=
(
1
<<
O
CIE1
B
);
/* Fire timer capture channel ISR to manage the software USART */
I
CR1
=
BITS_BETWEEN_USART_CLOCKS
;
TCCR1B
=
(
1
<<
WGM13
)
|
(
1
<<
WGM12
)
|
(
1
<<
CS10
);
TIMSK1
=
(
1
<<
I
CIE1
);
#endif
/* Send two BREAKs of 12 bits each to enable TPI interface (need at least 16 idle bits) */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment