亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? usbdrvasm.s

?? MEGA8USB5andavr.rar
?? S
?? 第 1 頁 / 共 2 頁
字號:
/* Name: usbdrvasm.S * Project: AVR USB driver * Author: Christian Starkjohann * Creation Date: 2004-12-29 * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: Proprietary, free under certain conditions. See Documentation. * This Revision: $Id: usbdrvasm.S 218 2006-07-15 17:08:14Z cs $ *//*General Description:This module implements the assembler part of the USB driver. See usbdrv.hfor a description of the entire driver.Since almost all of this code is timing critical, don't change unless youreally know what you are doing! Many parts require not only a maximum numberof CPU cycles, but even an exact number of cycles!Timing constraints according to spec (in bit times):timing subject                                      min max    CPUcycles---------------------------------------------------------------------------EOP of OUT/SETUP to sync pattern of DATA0 (both rx) 2   16     16-128EOP of IN to sync pattern of DATA0 (rx, then tx)    2   7.5    16-60DATAx (rx) to ACK/NAK/STALL (tx)                    2   7.5    16-60*/#include "iarcompat.h"#ifndef __IAR_SYSTEMS_ASM__    /* configs for io.h */#   define __SFR_OFFSET 0#   define _VECTOR(N)   __vector_ ## N   /* io.h does not define this for asm */#   include <avr/io.h> /* for CPU I/O register definitions and vectors */#endif  /* __IAR_SYSTEMS_ASM__ */#include "usbdrv.h" /* for common defs *//* register names */#define x1      r16#define x2      r17#define shift   r18#define cnt     r19#define x3      r20#define x4      r21/* Some assembler dependent definitions and declarations: */#ifdef __IAR_SYSTEMS_ASM__#   define nop2     rjmp    $+2 /* jump to next instruction */#   define XL       r26#   define XH       r27#   define YL       r28#   define YH       r29#   define ZL       r30#   define ZH       r31#   define lo8(x)   LOW(x)#   define hi8(x)   ((x)>>8)    /* not HIGH to allow XLINK to make a proper range check */    extern  usbRxBuf, usbDeviceAddr, usbNewDeviceAddr, usbInputBuf    extern  usbCurrentTok, usbRxLen, usbRxToken, usbAppBuf, usbTxLen    extern  usbTxBuf, usbMsgLen, usbTxLen1, usbTxBuf1, usbTxLen3, usbTxBuf3    public  usbCrc16    public  usbCrc16Append    COMMON  INTVEC    ORG     INT0_vect    rjmp    SIG_INTERRUPT0    RSEG    CODE#else /* __IAR_SYSTEMS_ASM__ */#   define nop2     rjmp    .+0 /* jump to next instruction */    .text    .global SIG_INTERRUPT0    .type   SIG_INTERRUPT0, @function    .global usbCrc16    .global usbCrc16Append#endif /* __IAR_SYSTEMS_ASM__ */SIG_INTERRUPT0:;Software-receiver engine. Strict timing! Don't change unless you can preserve timing!;interrupt response time: 4 cycles + insn running = 7 max if interrupts always enabled;max allowable interrupt latency: 32 cycles -> max 25 cycles interrupt disable;max stack usage: [ret(2), x1, SREG, x2, cnt, shift, YH, YL, x3, x4] = 11 bytesusbInterrupt:;order of registers pushed:;x1, SREG, x2, cnt, shift, [YH, YL, x3]    push    x1              ;2  push only what is necessary to sync with edge ASAP    in      x1, SREG        ;1    push    x1              ;2;sync byte (D-) pattern LSb to MSb: 01010100 [1 = idle = J, 0 = K];sync up with J to K edge during sync pattern -- use fastest possible loops;first part has no timeout because it waits for IDLE or SE1 (== disconnected)#if !USB_CFG_SAMPLE_EXACT    ldi     x1, 5           ;1 setup a timeout for waitForK#endifwaitForJ:    sbis    USBIN, USBMINUS ;1 wait for D- == 1    rjmp    waitForJ        ;2#if USB_CFG_SAMPLE_EXACT;The following code represents the unrolled loop in the else branch. It;results in a sampling window of 1/4 bit which meets the spec.    sbis    USBIN, USBMINUS    rjmp    foundK    sbis    USBIN, USBMINUS    rjmp    foundK    sbis    USBIN, USBMINUS    rjmp    foundK    nop    nop2foundK:#elsewaitForK:    dec     x1              ;1    sbic    USBIN, USBMINUS ;1 wait for D- == 0    brne    waitForK        ;2#endif;{2, 6} after falling D- edge, average delay: 4 cycles [we want 4 for center sampling];we have 1 bit time for setup purposes, then sample again:    push    x2              ;2    push    cnt             ;2    push    shift           ;2shortcutEntry:    ldi     cnt, 1          ;1 pre-init bit counter (-1 because no dec follows, -1 because 1 bit already sampled)    ldi     x2, 1<<USB_CFG_DPLUS_BIT    ;1 -> 8   edge sync ended with D- == 0;now wait until SYNC byte is over. Wait for either 2 bits low (success) or 2 bits high (failure)waitNoChange:    in      x1, USBIN       ;1 <-- sample, timing: edge + {2, 6} cycles    eor     x2, x1          ;1    sbrc    x2, USBMINUS    ;1 | 2    ldi     cnt, 2          ;1 | 0 cnt = numBits - 1 (because dec follows)    mov     x2, x1          ;1    dec     cnt             ;1    brne    waitNoChange    ;2 | 1    sbrc    x1, USBMINUS    ;2    rjmp    sofError        ;0 two consecutive "1" bits -> framing error;start reading data, but don't check for bitstuffing because these are the;first bits. Use the cycles for initialization instead. Note that we read and;store the binary complement of the data stream because eor results in 1 for;a change and 0 for no change.    in      x1, USBIN       ;1 <-- sample bit 0, timing: edge + {3, 7} cycles    eor     x2, x1          ;1    ldi     shift, 0x00     ;1 prepare for bitstuff check later on in loop    bst     x2, USBMINUS    ;1    bld     shift, 0        ;1    push    YH              ;2 -> 7    in      x2, USBIN       ;1 <-- sample bit 1, timing: edge + {2, 6} cycles    eor     x1, x2          ;1    bst     x1, USBMINUS    ;1    bld     shift, 1        ;1    push    YL              ;2    lds     YL, usbInputBuf ;2 -> 8    in      x1, USBIN       ;1 <-- sample bit 2, timing: edge + {2, 6} cycles    eor     x2, x1          ;1    bst     x2, USBMINUS    ;1    bld     shift, 2        ;1    ldi     cnt, USB_BUFSIZE;1    ldi     YH, hi8(usbRxBuf);1 assume that usbRxBuf does not cross a page    push    x3              ;2 -> 8    in      x2, USBIN       ;1 <-- sample bit 3, timing: edge + {2, 6} cycles    eor     x1, x2          ;1    bst     x1, USBMINUS    ;1    bld     shift, 3        ;1    ser     x3              ;1    nop                     ;1    rjmp    rxbit4          ;2 -> 8shortcutToStart:            ;{,43} into next frame: max 5.5 sync bits missed#if !USB_CFG_SAMPLE_EXACT    ldi     x1, 5           ;2 setup timeout#endifwaitForJ1:    sbis    USBIN, USBMINUS ;1 wait for D- == 1    rjmp    waitForJ1       ;2#if USB_CFG_SAMPLE_EXACT;The following code represents the unrolled loop in the else branch. It;results in a sampling window of 1/4 bit which meets the spec.    sbis    USBIN, USBMINUS    rjmp    foundK1    sbis    USBIN, USBMINUS    rjmp    foundK1    sbis    USBIN, USBMINUS    rjmp    foundK1    nop    nop2foundK1:#elsewaitForK1:    dec     x1              ;1    sbic    USBIN, USBMINUS ;1 wait for D- == 0    brne    waitForK1       ;2#endif    pop     YH              ;2 correct stack alignment    nop2                    ;2 delay for the same time as the pushes in the original code    rjmp    shortcutEntry   ;2; ################# receiver loop #################; extra jobs done during bit interval:; bit 6:    se0 check; bit 7:    or, store, clear; bit 0:    recover from delay  [SE0 is unreliable here due to bit dribbling in hubs]; bit 1:    se0 check; bit 2:    se0 check; bit 3:    overflow check; bit 4:    se0 check; bit 5:    rjmp; stuffed* helpers have the functionality of a subroutine, but we can't afford; the overhead of a call. We therefore need a separate routine for each caller; which jumps back appropriately.stuffed5:               ;1 for branch taken    in      x2, USBIN   ;1 <-- sample @ +1    andi    x2, USBMASK ;1    breq    se0a        ;1    andi    x3, ~0x20   ;1    ori     shift, 0x20 ;1    rjmp    rxbit6      ;2stuffed6:               ;1 for branch taken    in      x1, USBIN   ;1 <-- sample @ +1    andi    x1, USBMASK ;1    breq    se0a        ;1    andi    x3, ~0x40   ;1    ori     shift, 0x40 ;1    rjmp    rxbit7      ;2; This is somewhat special because it has to compensate for the delay in bit 7stuffed7:               ;1 for branch taken    andi    x1, USBMASK ;1 already sampled by caller    breq    se0a        ;1    mov     x2, x1      ;1 ensure correct NRZI sequence    ori     shift, 0x80 ;1 no need to set reconstruction in x3: shift has already been used    in      x1, USBIN   ;1 <-- sample bit 0    rjmp    unstuffed7  ;2stuffed0:               ;1 for branch taken    in      x1, USBIN   ;1 <-- sample @ +1    andi    x1, USBMASK ;1    breq    se0a        ;1    andi    x3, ~0x01   ;1    ori     shift, 0x01 ;1    rjmp    rxbit1      ;2;-----------------------------rxLoop:    breq    stuffed5    ;1rxbit6:    in      x1, USBIN   ;1 <-- sample bit 6    andi    x1, USBMASK ;1    breq    se0a        ;1    eor     x2, x1      ;1    bst     x2, USBMINUS;1    bld     shift, 6    ;1    cpi     shift, 0x02 ;1    brlo    stuffed6    ;1rxbit7:    in      x2, USBIN   ;1 <-- sample bit 7    eor     x1, x2      ;1    bst     x1, USBMINUS;1    bld     shift, 7    ;1    eor     x3, shift   ;1 x3 is 0 at bit locations we changed, 1 at others    st      y+, x3      ;2 the eor above reconstructed modified bits and inverted rx data    ser     x3          ;1rxbit0:    in      x1, USBIN   ;1 <-- sample bit 0    cpi     shift, 0x04 ;1    brlo    stuffed7    ;1unstuffed7:    eor     x2, x1      ;1    bst     x2, USBMINUS;1    bld     shift, 0    ;1    andi    shift, 0xf9 ;1    breq    stuffed0    ;1rxbit1:    in      x2, USBIN   ;1 <-- sample bit 1    andi    x2, USBMASK ;1se0a:                   ; enlarge jump range to SE0    breq    se0         ;1 check for SE0 more often close to start of byte    eor     x1, x2      ;1    bst     x1, USBMINUS;1    bld     shift, 1    ;1    andi    shift, 0xf3 ;1    breq    stuffed1    ;1rxbit2:    in      x1, USBIN   ;1 <-- sample bit 2    andi    x1, USBMASK ;1    breq    se0         ;1    eor     x2, x1      ;1    bst     x2, USBMINUS;1    bld     shift, 2    ;1    andi    shift, 0xe7 ;1    breq    stuffed2    ;1rxbit3:    in      x2, USBIN   ;1 <-- sample bit 3    eor     x1, x2      ;1    bst     x1, USBMINUS;1    bld     shift, 3    ;1    dec     cnt         ;1  check for buffer overflow    breq    overflow    ;1    andi    shift, 0xcf ;1    breq    stuffed3    ;1rxbit4:    in      x1, USBIN   ;1 <-- sample bit 4    andi    x1, USBMASK ;1    breq    se0         ;1    eor     x2, x1      ;1    bst     x2, USBMINUS;1    bld     shift, 4    ;1    andi    shift, 0x9f ;1    breq    stuffed4    ;1rxbit5:    in      x2, USBIN   ;1 <-- sample bit 5    eor     x1, x2      ;1    bst     x1, USBMINUS;1    bld     shift, 5    ;1    andi    shift, 0x3f ;1    rjmp    rxLoop      ;2;-----------------------------stuffed1:               ;1 for branch taken    in      x2, USBIN   ;1 <-- sample @ +1    andi    x2, USBMASK ;1    breq    se0         ;1    andi    x3, ~0x02   ;1    ori     shift, 0x02 ;1    rjmp    rxbit2      ;2stuffed2:               ;1 for branch taken    in      x1, USBIN   ;1 <-- sample @ +1    andi    x1, USBMASK ;1    breq    se0         ;1    andi    x3, ~0x04   ;1    ori     shift, 0x04 ;1    rjmp    rxbit3      ;2stuffed3:               ;1 for branch taken    in      x2, USBIN   ;1 <-- sample @ +1    andi    x2, USBMASK ;1    breq    se0         ;1    andi    x3, ~0x08   ;1    ori     shift, 0x08 ;1    rjmp    rxbit4      ;2stuffed4:               ;1 for branch taken    in      x1, USBIN   ;1 <-- sample @ +1    andi    x1, USBMASK ;1    breq    se0         ;1    andi    x3, ~0x10   ;1    ori     shift, 0x10 ;1    rjmp    rxbit5      ;2;################ end receiver loop ###############overflow:                   ; ignore package if buffer overflow    rjmp    rxDoReturn      ; enlarge jump range;This is the only non-error exit point for the software receiver loop;{4, 20} cycles after start of SE0, typically {10, 18} after SE0 start = {-6, 2} from end of SE0;next sync starts {16,} cycles after SE0 -> worst case start: +4 from next sync start;we don't check any CRCs here because there is no time left.se0:                            ;{-6, 2} from end of SE0 / {,4} into next frame    mov     cnt, YL             ;1 assume buffer in lower 256 bytes of memory    lds     YL, usbInputBuf     ;2 reposition to buffer start    sub     cnt, YL             ;1 length of message    ldi     x1, 1<<USB_INTR_PENDING_BIT ;1    cpi     cnt, 3              ;1    out     USB_INTR_PENDING, x1;1 clear pending intr and check flag later. SE0 must be over. {,10} into next frame    brlo    rxDoReturn          ;1 ensure valid packet size, ignore others    ld      x1, y               ;2 PID    ldd     x2, y+1             ;2 ADDR + 1 bit endpoint number    mov     x3, x2              ;1 store for endpoint number    andi    x2, 0x7f            ;1 mask endpoint number bit    lds     shift, usbDeviceAddr;2    cpi     x1, USBPID_SETUP    ;1    breq    isSetupOrOut        ;2 -> 19 = {13, 21} from SE0 end    cpi     x1, USBPID_OUT      ;1    breq    isSetupOrOut        ;2 -> 22 = {16, 24} from SE0 end / {,24} into next frame    cpi     x1, USBPID_IN       ;1    breq    handleIn            ;1#define USB_DATA_MASK   ~(USBPID_DATA0 ^ USBPID_DATA1)    andi    x1, USB_DATA_MASK   ;1    cpi     x1, USBPID_DATA0 & USB_DATA_MASK ;1    brne    rxDoReturn          ;1 not a data PID -- ignoreisData:    lds     x2, usbCurrentTok   ;2    tst     x2                  ;1    breq    rxDoReturn          ;1 for other device or spontaneous data -- ignore    lds     x1, usbRxLen        ;2

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99久国产精品黄毛片色诱| 日韩一区二区在线观看视频播放| 亚洲一区在线播放| 久久综合色之久久综合| 一本久久精品一区二区| 麻豆91在线看| 一区二区三区四区精品在线视频| 精品日本一线二线三线不卡| 国产伦精一区二区三区| 欧美成人精品3d动漫h| 色综合一区二区| 久久99国产精品久久99果冻传媒| 亚洲老妇xxxxxx| 久久精品在线观看| 欧美一区二区日韩一区二区| 欧美一区二区三区视频免费播放| 欧美丰满高潮xxxx喷水动漫| av亚洲精华国产精华精| 久久99精品一区二区三区| 亚洲bdsm女犯bdsm网站| 亚洲色大成网站www久久九九| 337p粉嫩大胆噜噜噜噜噜91av | 91精品国产91久久综合桃花| 色婷婷综合激情| 成人免费毛片嘿嘿连载视频| 国产一区二区精品久久99| 亚洲va在线va天堂| 成人欧美一区二区三区1314| 国产女人水真多18毛片18精品视频| 欧美剧情电影在线观看完整版免费励志电影| 99久久777色| 东方aⅴ免费观看久久av| 国产精品一区二区果冻传媒| 极品美女销魂一区二区三区| 免费的成人av| 蜜臀99久久精品久久久久久软件| 午夜激情一区二区| 天使萌一区二区三区免费观看| 亚洲国产成人av好男人在线观看| 亚洲国产一区二区a毛片| 一区二区三区免费观看| 亚洲精品日产精品乱码不卡| 亚洲美女在线国产| 亚洲综合无码一区二区| 亚洲激情在线激情| 亚洲国产精品尤物yw在线观看| 亚洲国产一区视频| 亚洲成人久久影院| 三级不卡在线观看| 蜜桃精品视频在线| 久久国产欧美日韩精品| 久久超碰97中文字幕| 国内精品嫩模私拍在线| 国产一区二区三区香蕉| 粉嫩av一区二区三区粉嫩| 欧美一级xxx| 欧美日韩三级一区| 日本一区二区久久| 色综合久久66| 欧美调教femdomvk| 欧美午夜电影网| 欧美日韩成人一区二区| 日韩亚洲欧美在线观看| 久久久午夜电影| 国产精品国产成人国产三级| 中文字幕不卡的av| 日韩免费看的电影| 久久久99精品免费观看| 国产精品视频yy9299一区| 亚洲黄色av一区| 老司机精品视频线观看86 | 亚洲天堂av一区| 亚洲成a人片在线观看中文| 久久不见久久见免费视频1| 国产激情一区二区三区四区 | 色视频欧美一区二区三区| 欧美精品在线一区二区三区| 久久久久久综合| 亚洲美女免费在线| 美女视频网站久久| gogogo免费视频观看亚洲一| 欧美日韩精品一区二区天天拍小说 | 国产三级欧美三级| 中文字幕一区二区三区四区不卡| 日韩理论片中文av| 日韩vs国产vs欧美| 99久久综合精品| 日韩一级片在线播放| 亚洲三级电影全部在线观看高清| 热久久国产精品| 91蜜桃在线观看| 欧美电视剧在线看免费| 一区二区成人在线观看| 国产一区二区三区精品视频| 在线观看一区日韩| 欧美国产丝袜视频| 麻豆精品国产91久久久久久| 97精品国产97久久久久久久久久久久| 91精品久久久久久久99蜜桃| 亚洲色图视频网站| 国产精品 日产精品 欧美精品| 欧美日韩一级视频| 国产精品短视频| 激情文学综合网| 91精品国产入口| 亚洲一区二区三区不卡国产欧美 | 国产精品一区二区无线| 欧美日韩激情一区二区| 国产精品国产三级国产普通话蜜臀| 日韩电影免费在线观看网站| 色综合一区二区| 国产精品初高中害羞小美女文| 久久99精品久久久久久国产越南| 欧美日韩在线一区二区| 一区免费观看视频| 懂色av一区二区三区蜜臀| 精品国产91乱码一区二区三区 | 国产伦精品一区二区三区免费迷| 欧美日韩一区小说| 亚洲在线视频一区| 色综合天天天天做夜夜夜夜做| 国产日韩欧美一区二区三区综合| 久久精品国产99国产| 日韩一区二区中文字幕| 日本不卡一区二区三区| 欧美精品三级在线观看| 亚洲国产精品久久不卡毛片| 在线日韩国产精品| 亚洲人123区| 色又黄又爽网站www久久| 亚洲欧洲日韩在线| 99久久久精品免费观看国产蜜| 久久久国产精华| 国产成a人亚洲| 国产色一区二区| 国产成人亚洲综合色影视| 久久久久久久久伊人| 国产精品99久久久久久宅男| 欧美色视频在线观看| 欧美一区二区三区四区久久| 日韩不卡一二三区| 精品国产乱码久久久久久夜甘婷婷 | 成人激情校园春色| 国产亲近乱来精品视频 | 色老头久久综合| 亚洲一区视频在线| 精品视频1区2区| 另类小说一区二区三区| 久久久亚洲精品一区二区三区 | 日本欧美在线看| 亚洲精品一区二区精华| 激情综合五月婷婷| 国产欧美一区二区精品忘忧草| 成人精品视频.| 一区二区三区四区av| 欧美日韩日日夜夜| 看国产成人h片视频| 国产偷国产偷精品高清尤物| 成人动漫精品一区二区| 日韩三级av在线播放| 国精产品一区一区三区mba视频| 欧美激情综合在线| 91丨九色丨黑人外教| 偷窥少妇高潮呻吟av久久免费| 欧美成人性战久久| 不卡在线观看av| 国产精品三级av| 99国产精品久久久久| 亚洲在线视频网站| 精品成人一区二区| 99久久精品国产一区二区三区| 亚洲一区二区三区四区不卡| 日韩一区二区三区电影在线观看| 精品无码三级在线观看视频| 亚洲欧洲性图库| 欧美一级二级三级乱码| www.亚洲在线| 日本亚洲最大的色成网站www| 2020国产精品久久精品美国| 91浏览器入口在线观看| 奇米888四色在线精品| 国产精品日韩成人| 欧美日韩国产精品自在自线| 粉嫩一区二区三区性色av| 午夜天堂影视香蕉久久| 国产日产欧美一区| 欧美伦理视频网站| 不卡影院免费观看| 精品在线免费观看| 夜夜嗨av一区二区三区| 久久久精品2019中文字幕之3| 欧美视频中文字幕| 亚洲成av人影院| 国产女主播在线一区二区| 欧美猛男gaygay网站| 成人国产亚洲欧美成人综合网| 秋霞午夜鲁丝一区二区老狼| 18欧美亚洲精品| 久久久久亚洲综合| 91精品国产综合久久久久久久|