projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
USBasp 2006.09.16.
[pub/USBasp.git]
/
firmware
/
main.c
diff --git
a/firmware/main.c
b/firmware/main.c
index
c5624d3
..
a01cfe8
100644
(file)
--- a/
firmware/main.c
+++ b/
firmware/main.c
@@
-214,9
+214,18
@@
uchar usbFunctionWrite(uchar *data, uchar len) {
int main(void)
{
int main(void)
{
+ uchar i, j;
+
PORTD = 0;
PORTB = 0; /* no pullups on USB and ISP pins */
DDRD = ~(1 << 2); /* all outputs except PD2 = INT0 */
PORTD = 0;
PORTB = 0; /* no pullups on USB and ISP pins */
DDRD = ~(1 << 2); /* all outputs except PD2 = INT0 */
+
+ DDRB = ~0; /* output SE0 for USB reset */
+ j = 0;
+ while(--j){ /* USB Reset by device only required on Watchdog Reset */
+ i = 0;
+ while(--i); /* delay >10ms for USB reset */
+ }
DDRB = 0; /* all USB and ISP pins inputs */
DDRC = 0x03; /* all inputs except PC0, PC1 */
DDRB = 0; /* all USB and ISP pins inputs */
DDRC = 0x03; /* all inputs except PC0, PC1 */