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

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

?? usbdrvasm.s

?? AVR s AVR-CDC
?? 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 205 2006-06-23 19:01:45Z 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, usbNakBuf, usbAckBuf, usbTxLen1, usbTxBuf1    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一区二区三区免费野_久草精品视频
欧洲色大大久久| 91浏览器入口在线观看| 日本乱码高清不卡字幕| 日韩欧美精品在线| 亚洲另类色综合网站| 国模一区二区三区白浆| 在线精品视频免费观看| 欧美精品一区二区三区一线天视频| 亚洲精品成人悠悠色影视| 国产精品一卡二卡| 欧美一级精品大片| 亚洲韩国一区二区三区| 成人激情动漫在线观看| 久久先锋资源网| 奇米四色…亚洲| 欧美在线观看一二区| 国产精品成人一区二区三区夜夜夜 | 卡一卡二国产精品| 欧美三级电影在线观看| 亚洲欧洲美洲综合色网| 国产91精品免费| 精品粉嫩超白一线天av| 日韩影院免费视频| 91黄色免费网站| 国产精品嫩草影院com| 青娱乐精品视频| 色吊一区二区三区| 中文字幕精品在线不卡| 麻豆精品视频在线观看视频| 在线观看www91| 成人免费在线观看入口| 麻豆91在线观看| 欧美日韩亚洲另类| 综合久久一区二区三区| 国产在线视频一区二区三区| 6080日韩午夜伦伦午夜伦| 亚洲三级小视频| 国产69精品久久99不卡| 欧美一级午夜免费电影| 亚洲成人自拍偷拍| 91亚洲精品一区二区乱码| 欧美国产精品一区| 秋霞电影一区二区| 欧美一区二区视频观看视频| 亚洲不卡一区二区三区| 在线观看三级视频欧美| 亚洲日本青草视频在线怡红院| 国产精品一区二区91| 2017欧美狠狠色| 麻豆高清免费国产一区| 91精品在线观看入口| 亚洲国产成人av好男人在线观看| 成人一区二区三区| 国产三级久久久| 国产成人aaa| 久久精品日产第一区二区三区高清版| 免费久久99精品国产| 欧美一级视频精品观看| 秋霞电影一区二区| 欧美日韩成人一区二区| 午夜久久久久久| 欧美日韩成人一区二区| 天堂va蜜桃一区二区三区漫画版| 欧美日韩色一区| 午夜精品久久久久久久久| 欧美怡红院视频| 亚洲成人tv网| 欧美一卡二卡在线| 麻豆精品久久精品色综合| 91精品国产综合久久久蜜臀粉嫩 | 欧美日韩中文字幕一区| 亚洲综合一区在线| 欧美三级视频在线播放| 亚洲国产日韩一区二区| 欧美日韩第一区日日骚| 青青草91视频| 日韩欧美国产一二三区| 国产一区在线不卡| 国产欧美一区二区精品久导航 | 欧美激情综合五月色丁香 | 有坂深雪av一区二区精品| 91久久精品一区二区三| 亚洲午夜私人影院| 欧美一区日本一区韩国一区| 麻豆精品精品国产自在97香蕉| 精品国产a毛片| 国产超碰在线一区| 国产精品灌醉下药二区| 色呦呦国产精品| 午夜精品一区二区三区免费视频 | 蜜桃av一区二区三区电影| 久久综合九色综合欧美就去吻| 国产成人在线色| 亚洲精品中文在线| 欧美一级日韩免费不卡| 久久99久久久久| 亚洲视频一二三区| 欧美久久久久久蜜桃| 韩国一区二区三区| 17c精品麻豆一区二区免费| 欧美三级视频在线观看| 国产主播一区二区三区| 中文字幕在线一区二区三区| 欧美日韩成人激情| 国产精品亚洲午夜一区二区三区 | 欧美日韩国产另类一区| 国产一本一道久久香蕉| 一区二区三区鲁丝不卡| 日韩美女主播在线视频一区二区三区 | 欧美中文字幕一区| 久久成人免费日本黄色| 国产精品久久久久久久蜜臀| 91精品免费观看| 99久久综合精品| 日韩在线a电影| 国产三级三级三级精品8ⅰ区| 在线影院国内精品| 精品制服美女丁香| 亚洲免费在线观看| 日韩丝袜美女视频| 成人免费av网站| 三级精品在线观看| 国产欧美日韩另类视频免费观看| 精品视频1区2区3区| 成人综合在线观看| 热久久国产精品| 亚洲美女视频在线观看| 久久女同精品一区二区| 精品视频一区三区九区| 不卡视频在线观看| 美女一区二区久久| 一区二区三区在线免费视频| 久久久综合视频| 欧美色精品天天在线观看视频| 成人午夜激情影院| 午夜精品成人在线| 一区二区免费看| 久久久久久久久一| 在线播放/欧美激情| 色综合咪咪久久| 毛片av一区二区| 亚洲成人激情综合网| 国产精品久久久久久久久快鸭| 欧美不卡123| 精品视频资源站| a级精品国产片在线观看| 韩国一区二区在线观看| 日韩综合在线视频| 亚洲自拍欧美精品| 亚洲日本乱码在线观看| 久久久精品天堂| 7777女厕盗摄久久久| 在线日韩国产精品| 99re这里只有精品首页| 懂色av中文字幕一区二区三区| 久久99国产精品免费| 天天综合网天天综合色| 色94色欧美sute亚洲线路二| 狠狠色综合色综合网络| 蜜臀av性久久久久蜜臀aⅴ | 在线不卡欧美精品一区二区三区| 不卡一区在线观看| 成人一二三区视频| 久久99国产精品成人| 秋霞国产午夜精品免费视频| 午夜精品福利久久久| 亚洲成人1区2区| 亚洲不卡av一区二区三区| 亚洲国产日韩一区二区| 亚洲国产成人av网| 一区二区三区精品在线观看| 樱桃视频在线观看一区| 中文字幕精品一区| 337p日本欧洲亚洲大胆色噜噜| 欧美精品丝袜中出| 欧美综合在线视频| 欧美视频完全免费看| 欧美日韩国产另类不卡| 在线观看日韩高清av| 色999日韩国产欧美一区二区| 日本久久精品电影| 91国产精品成人| 欧美日韩在线精品一区二区三区激情| 色天天综合色天天久久| 色域天天综合网| 欧美日韩免费视频| 3d动漫精品啪啪| 日韩欧美精品在线| 久久综合久久99| 精品99999| 国产精品久久99| 亚洲免费大片在线观看| 又紧又大又爽精品一区二区| 亚洲成人精品影院| 日本成人在线网站| 国产夫妻精品视频| 91丝袜美腿高跟国产极品老师| 欧美专区亚洲专区| 色婷婷亚洲精品| 日韩欧美国产三级|