diff options
author | cpldcpu <cpldcpu@gmail.com> | 2014-01-05 12:09:34 +0100 |
---|---|---|
committer | cpldcpu <cpldcpu@gmail.com> | 2014-01-05 12:09:34 +0100 |
commit | a1a11ed4888bfd84f2215321489b25944404b6ab (patch) | |
tree | 0ff67bd7f5f96267e103c38fc24b11cee4364f8b /firmware/usbdrv | |
parent | c4907c6896943eb3ff778cb007a9891ac7b68248 (diff) | |
download | micronucleus-a1a11ed4888bfd84f2215321489b25944404b6ab.tar.gz micronucleus-a1a11ed4888bfd84f2215321489b25944404b6ab.tar.bz2 micronucleus-a1a11ed4888bfd84f2215321489b25944404b6ab.zip |
firmware: first working version with polled usb
Diffstat (limited to 'firmware/usbdrv')
-rw-r--r-- | firmware/usbdrv/asmcommon.inc | 2 | ||||
-rw-r--r-- | firmware/usbdrv/usbdrvasm165.inc | 23 |
2 files changed, 5 insertions, 20 deletions
diff --git a/firmware/usbdrv/asmcommon.inc b/firmware/usbdrv/asmcommon.inc index 5e525f5..b7efadb 100644 --- a/firmware/usbdrv/asmcommon.inc +++ b/firmware/usbdrv/asmcommon.inc @@ -99,6 +99,8 @@ doReturn: rjmp waitForJ ;[51] save the pops and pushes -- a new interrupt is already pending sofError: POP_RETI ;macro call + + CBI PORTB,0 ; reti ret diff --git a/firmware/usbdrv/usbdrvasm165.inc b/firmware/usbdrv/usbdrvasm165.inc index 20457f4..a6c76f6 100644 --- a/firmware/usbdrv/usbdrvasm165.inc +++ b/firmware/usbdrv/usbdrvasm165.inc @@ -45,30 +45,13 @@ of CPU cycles, but even an exact number of cycles! USB_INTR_VECTOR: ;order of registers pushed: YL, SREG [sofError], r0, YH, shift, x1, x2, x3, x4, cnt + SBI PORTB,0 + push YL ; push only what is necessary to sync with edge ASAP in YL, SREG ; push YL ; -#if 0 - cpi YL, 0xB0 - brne cleanupAndJumpToApp - - lds YL, RAMEND-1 - cpi YL, 0x07 - breq cleanupBootloaderIntStack - -cleanupAndJumpToApp: -; magic word was not found, put registers back to where they were before this ISR ran, and jump to application ISR - pop YL - out SREG, YL - pop YL - - rjmp __vectors - TINYVECTOR_USBPLUS_OFFSET - -cleanupBootloaderIntStack: -; magic word was found, put registers - CLR YL ; [-19] ensure we meet below requirements for YL < 0x80 -#endif + ;---------------------------------------------------------------------------- ; Synchronize with sync pattern: ;---------------------------------------------------------------------------- |