diff options
author | AJM <poslathian@poslathian.(none)> | 2010-06-09 22:25:14 -0400 |
---|---|---|
committer | AJM <poslathian@poslathian.(none)> | 2010-06-09 22:25:14 -0400 |
commit | be5593982965b22518c0605ef951574b4b97c871 (patch) | |
tree | 7d2b7dc51726b73474d00e0fa189ecd81fc380b5 /libmaple/usb/usb.c | |
parent | 8afc89be1da70c2776333b3858532c6b753e11ce (diff) | |
download | librambutan-be5593982965b22518c0605ef951574b4b97c871.tar.gz librambutan-be5593982965b22518c0605ef951574b4b97c871.zip |
added a somewhat broken version of the reset magic number scheme.
current version gets stuck in the isr somewhere. not sure why or where. must debug.
Diffstat (limited to 'libmaple/usb/usb.c')
-rw-r--r-- | libmaple/usb/usb.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c index 09b51ea..9755618 100644 --- a/libmaple/usb/usb.c +++ b/libmaple/usb/usb.c @@ -335,8 +335,7 @@ if (wIstr & ISTR_CTR & wInterrupt_Mask) } void usbWaitReset(void) { - int count = program_delay*100000000; - delay(program_delay*10); + delay(RESET_DELAY); systemHardReset(); } @@ -350,7 +349,7 @@ void usbWaitReset(void) { */ int16 usbSendBytes(uint8* sendBuf, uint16 len) { - if (reset_state != START || bDeviceState != CONFIGURED) { + if (((line_dtr_rts & 0x02) != 0) || bDeviceState != CONFIGURED) { return -1; /* indicates to caller to stop trying, were not connected */ } |