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

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

?? usbdrvasm16.s

?? 使用ATTiny26的USBasp,簡單AVR編程軟件
?? S
?? 第 1 頁 / 共 2 頁
字號:
/* Name: usbdrvasm16.S * Project: AVR USB driver * Author: Christian Starkjohann * Creation Date: 2007-06-15 * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) * Revision: $Id$ *//* Do not link this file! Link usbdrvasm.S instead, which includes the * appropriate implementation! *//*General Description:This file is the 16 MHz version of the asssembler part of the USB driver. Itrequires a 16 MHz crystal (not a ceramic resonator and not a calibrated RCoscillator).See usbdrv.h for 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!*/;max stack usage: [ret(2), YL, SREG, YH, bitcnt, shift, x1, x2, x3, x4, cnt] = 12 bytes;nominal frequency: 16 MHz -> 10.6666666 cycles per bit, 85.333333333 cycles per byte; Numbers in brackets are clocks counted from center of last sync bit; when instruction startsSIG_INTERRUPT0:;order of registers pushed: YL, SREG YH, [sofError], bitcnt, shift, x1, x2, x3, x4, cnt    push    YL                  ;[-25] push only what is necessary to sync with edge ASAP    in      YL, SREG            ;[-23]    push    YL                  ;[-22]    push    YH                  ;[-20];----------------------------------------------------------------------------; Synchronize with sync pattern:;----------------------------------------------------------------------------;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)waitForJ:    sbis    USBIN, USBMINUS     ;[-18] wait for D- == 1    rjmp    waitForJwaitForK:;The following code results in a sampling window of < 1/4 bit which meets the spec.    sbis    USBIN, USBMINUS     ;[-15]    rjmp    foundK              ;[-14]    sbis    USBIN, USBMINUS    rjmp    foundK    sbis    USBIN, USBMINUS    rjmp    foundK    sbis    USBIN, USBMINUS    rjmp    foundK    sbis    USBIN, USBMINUS    rjmp    foundK    sbis    USBIN, USBMINUS    rjmp    foundK    rjmp    sofErrorfoundK:                         ;[-12];{3, 5} after falling D- edge, average delay: 4 cycles [we want 5 for center sampling];we have 1 bit time for setup purposes, then sample again. Numbers in brackets;are cycles from center of first sync (double K) bit after the instruction    push    bitcnt              ;[-12];   [---]                       ;[-11]    lds     YL, usbInputBufOffset;[-10];   [---]                       ;[-9]    clr     YH                  ;[-8]    subi    YL, lo8(-(usbRxBuf));[-7] [rx loop init]    sbci    YH, hi8(-(usbRxBuf));[-6] [rx loop init]    push    shift               ;[-5];   [---]                       ;[-4]    ldi     bitcnt, 0x55        ;[-3] [rx loop init]    sbis    USBIN, USBMINUS     ;[-2] we want two bits K (sample 2 cycles too early)    rjmp    haveTwoBitsK        ;[-1]    pop     shift               ;[0] undo the push from before    pop     bitcnt              ;[2] undo the push from before    rjmp    waitForK            ;[4] this was not the end of sync, retry; The entire loop from waitForK until rjmp waitForK above must not exceed two; bit times (= 21 cycles).;----------------------------------------------------------------------------; push more registers and initialize values while we sample the first bits:;----------------------------------------------------------------------------haveTwoBitsK:    push    x1              ;[1]    push    x2              ;[3]    push    x3              ;[5]    ldi     shift, 0        ;[7]    ldi     x3, 1<<4        ;[8] [rx loop init] first sample is inverse bit, compensate that    push    x4              ;[9] == leap    in      x1, USBIN       ;[11] <-- sample bit 0    andi    x1, USBMASK     ;[12]    bst     x1, USBMINUS    ;[13]    bld     shift, 7        ;[14]    push    cnt             ;[15]    ldi     leap, 0         ;[17] [rx loop init]    ldi     cnt, USB_BUFSIZE;[18] [rx loop init]    rjmp    rxbit1          ;[19] arrives at [21];----------------------------------------------------------------------------; Receiver loop (numbers in brackets are cycles within byte after instr);----------------------------------------------------------------------------unstuff6:    andi    x2, USBMASK ;[03]    ori     x3, 1<<6    ;[04] will not be shifted any more    andi    shift, ~0x80;[05]    mov     x1, x2      ;[06] sampled bit 7 is actually re-sampled bit 6    subi    leap, 3     ;[07] since this is a short (10 cycle) bit, enforce leap bit    rjmp    didUnstuff6 ;[08]unstuff7:    ori     x3, 1<<7    ;[09] will not be shifted any more    in      x2, USBIN   ;[00] [10]  re-sample bit 7    andi    x2, USBMASK ;[01]    andi    shift, ~0x80;[02]    subi    leap, 3     ;[03] since this is a short (10 cycle) bit, enforce leap bit    rjmp    didUnstuff7 ;[04]unstuffEven:    ori     x3, 1<<6    ;[09] will be shifted right 6 times for bit 0    in      x1, USBIN   ;[00] [10]    andi    shift, ~0x80;[01]    andi    x1, USBMASK ;[02]    breq    se0         ;[03]    subi    leap, 3     ;[04] since this is a short (10 cycle) bit, enforce leap bit    nop                 ;[05]    rjmp    didUnstuffE ;[06]unstuffOdd:    ori     x3, 1<<5    ;[09] will be shifted right 4 times for bit 1    in      x2, USBIN   ;[00] [10]    andi    shift, ~0x80;[01]    andi    x2, USBMASK ;[02]    breq    se0         ;[03]    subi    leap, 3     ;[04] since this is a short (10 cycle) bit, enforce leap bit    nop                 ;[05]    rjmp    didUnstuffO ;[06]rxByteLoop:    andi    x1, USBMASK ;[03]    eor     x2, x1      ;[04]    subi    leap, 1     ;[05]    brpl    skipLeap    ;[06]    subi    leap, -3    ;1 one leap cycle every 3rd byte -> 85 + 1/3 cycles per byte    nop                 ;1skipLeap:    subi    x2, 1       ;[08]    ror     shift       ;[09]didUnstuff6:    cpi     shift, 0xfc ;[10]    in      x2, USBIN   ;[00] [11] <-- sample bit 7    brcc    unstuff6    ;[01]    andi    x2, USBMASK ;[02]    eor     x1, x2      ;[03]    subi    x1, 1       ;[04]    ror     shift       ;[05]didUnstuff7:    cpi     shift, 0xfc ;[06]    brcc    unstuff7    ;[07]    eor     x3, shift   ;[08] reconstruct: x3 is 1 at bit locations we changed, 0 at others    st      y+, x3      ;[09] store datarxBitLoop:    in      x1, USBIN   ;[00] [11] <-- sample bit 0/2/4    andi    x1, USBMASK ;[01]    eor     x2, x1      ;[02]    andi    x3, 0x3f    ;[03] topmost two bits reserved for 6 and 7    subi    x2, 1       ;[04]    ror     shift       ;[05]    cpi     shift, 0xfc ;[06]    brcc    unstuffEven ;[07]didUnstuffE:    lsr     x3          ;[08]    lsr     x3          ;[09]rxbit1:    in      x2, USBIN   ;[00] [10] <-- sample bit 1/3/5    andi    x2, USBMASK ;[01]    breq    se0         ;[02]    eor     x1, x2      ;[03]    subi    x1, 1       ;[04]    ror     shift       ;[05]    cpi     shift, 0xfc ;[06]    brcc    unstuffOdd  ;[07]didUnstuffO:    subi    bitcnt, 0xab;[08] == addi 0x55, 0x55 = 0x100/3    brcs    rxBitLoop   ;[09]    subi    cnt, 1      ;[10]    in      x1, USBIN   ;[00] [11] <-- sample bit 6    brcc    rxByteLoop  ;[01]    rjmp    ignorePacket; overflow;----------------------------------------------------------------------------; Processing of received packet (numbers in brackets are cycles after center of SE0);----------------------------------------------------------------------------;This is the only non-error exit point for the software receiver loop;we don't check any CRCs here because there is no time left.#define token   x1se0:    subi    cnt, USB_BUFSIZE    ;[5]    neg     cnt                 ;[6]    cpi     cnt, 3              ;[7]    ldi     x2, 1<<USB_INTR_PENDING_BIT ;[8]    out     USB_INTR_PENDING, x2;[9] clear pending intr and check flag later. SE0 should be over.    brlo    doReturn            ;[10] this is probably an ACK, NAK or similar packet    sub     YL, cnt             ;[11]    sbci    YH, 0               ;[12]    ld      token, y            ;[13]    cpi     token, USBPID_DATA0 ;[15]    breq    handleData          ;[16]    cpi     token, USBPID_DATA1 ;[17]    breq    handleData          ;[18]    ldd     x2, y+1             ;[19] ADDR and 1 bit endpoint number    mov     x3, x2              ;[21] store for endpoint number    andi    x2, 0x7f            ;[22] x2 is now ADDR    lds     shift, usbDeviceAddr;[23]    cp      x2, shift           ;[25]overflow:                       ; This is a hack: brcs overflow will never have Z flag set    brne    ignorePacket        ;[26] packet for different address    cpi     token, USBPID_IN    ;[27]    breq    handleIn            ;[28]    cpi     token, USBPID_SETUP ;[29]    breq    handleSetupOrOut    ;[30]    cpi     token, USBPID_OUT   ;[31]    breq    handleSetupOrOut    ;[32];   rjmp    ignorePacket        ;fallthrough, should not happen anyway.ignorePacket:    clr     shift    sts     usbCurrentTok, shift

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久天天做天天爱综合色| 一区二区三区电影在线播| 亚洲欧美日本在线| 日韩国产在线一| 成人高清视频在线| 精品成人在线观看| 亚洲成av人片在线观看| 白白色 亚洲乱淫| 日韩一区二区三免费高清| 一色屋精品亚洲香蕉网站| 蜜臀精品一区二区三区在线观看| 99国产精品久久| 欧美国产精品一区| 韩国女主播成人在线观看| 制服丝袜中文字幕一区| 一区二区三区在线免费视频| 成人网页在线观看| 久久丝袜美腿综合| 久久99久久99| 91精品国产色综合久久ai换脸 | 国产欧美日韩中文久久| 蜜桃一区二区三区在线| 欧美午夜不卡视频| 亚洲综合色在线| 99综合电影在线视频| 国产日韩影视精品| 国产精品一区在线观看乱码 | 日韩精品国产精品| 欧美日韩激情一区二区| 亚洲欧美福利一区二区| 色综合久久综合| 亚洲精品日韩综合观看成人91| 成人av中文字幕| 中文字幕中文字幕一区二区| 成人综合婷婷国产精品久久免费| 欧美精彩视频一区二区三区| 国产99精品视频| 国产精品天美传媒| 91社区在线播放| 亚洲综合免费观看高清完整版 | 91久久精品国产91性色tv| 亚洲人成网站影音先锋播放| 91视频一区二区| 亚洲激情欧美激情| 91精品国产综合久久小美女| 日韩不卡免费视频| 久久久久久一二三区| 成人av在线播放网站| 亚洲精品国产第一综合99久久| 在线观看欧美精品| 青娱乐精品在线视频| 久久久久久影视| 91香蕉视频在线| 午夜精品福利在线| 久久精品一区二区三区av| voyeur盗摄精品| 亚洲va欧美va国产va天堂影院| 日韩欧美久久一区| 成熟亚洲日本毛茸茸凸凹| 亚洲午夜久久久久久久久电影网| 欧美一区二区三区视频| 国产91精品一区二区| 亚洲va欧美va人人爽| 久久这里只精品最新地址| 91免费小视频| 六月婷婷色综合| 亚洲视频综合在线| 日韩亚洲欧美一区| av在线这里只有精品| 亚洲va天堂va国产va久| 国产午夜久久久久| 欧美日韩成人综合| av电影一区二区| 麻豆精品视频在线观看| 国产精品成人一区二区三区夜夜夜| 亚洲精品在线电影| 91在线观看视频| 久久丁香综合五月国产三级网站| 亚洲色图视频网站| 精品国产一区二区三区久久影院| 色8久久人人97超碰香蕉987| 国模娜娜一区二区三区| 亚洲成人av在线电影| 成人欧美一区二区三区| 精品国产乱码久久久久久闺蜜 | 亚洲综合激情另类小说区| 久久久久99精品国产片| 欧美少妇xxx| caoporn国产一区二区| 欧美aaaaaa午夜精品| 亚洲免费在线播放| 亚洲国产成人午夜在线一区| 精品国产一区二区三区四区四| 欧美日韩一区久久| 91免费小视频| 成人午夜看片网址| 国产v综合v亚洲欧| 国产一区二区三区综合| 日韩激情在线观看| 亚洲一区在线观看视频| 亚洲美女视频一区| 中文字幕欧美一| 中文av一区二区| 国产亚洲精品aa午夜观看| 久久午夜羞羞影院免费观看| 日韩欧美国产麻豆| 欧美一区二区三区视频免费播放| 欧美日韩中文另类| 久久综合色8888| 欧美变态tickling挠脚心| 欧美一区二区三区四区高清 | 美女诱惑一区二区| 奇米色一区二区| 美女一区二区久久| 久久66热偷产精品| 久久成人羞羞网站| 精品一区二区久久| 国产另类ts人妖一区二区| 国产.欧美.日韩| av在线这里只有精品| 91蝌蚪porny| 欧美色手机在线观看| 欧美三级中文字幕| 欧美高清www午色夜在线视频| 91麻豆精品国产91久久久更新时间| 在线播放欧美女士性生活| 7777精品伊人久久久大香线蕉超级流畅 | 欧美亚一区二区| 欧美二区在线观看| 日韩区在线观看| 国产日韩综合av| 亚洲精品国产精华液| 午夜精品久久久久久久| 久久不见久久见免费视频1| 国产电影一区二区三区| www.亚洲国产| 欧美日韩二区三区| 精品对白一区国产伦| 中文字幕av一区 二区| 亚洲美女区一区| 日本va欧美va瓶| 成人激情电影免费在线观看| 91官网在线免费观看| 日韩欧美在线影院| 欧美高清一级片在线观看| 一区二区三区久久久| 激情六月婷婷久久| 色综合天天在线| 日韩一区二区在线观看视频播放| 中文字幕国产精品一区二区| 亚洲国产一区二区三区青草影视| 久久国产剧场电影| 日本高清免费不卡视频| 欧美变态tickle挠乳网站| 亚洲私人黄色宅男| 狠狠色狠狠色综合系列| 色综合天天视频在线观看| 日韩一区二区在线观看视频| 成人欧美一区二区三区白人 | 五月综合激情婷婷六月色窝| 国产传媒欧美日韩成人| 欧美日韩精品电影| 偷拍亚洲欧洲综合| 成人一区在线看| 日韩三区在线观看| 一区二区三区免费网站| 成人手机在线视频| 91精品国产91热久久久做人人| 国产精品灌醉下药二区| 麻豆精品视频在线观看视频| 色婷婷综合久久久中文一区二区 | 国产91精品在线观看| 欧美一级午夜免费电影| 亚洲一区二区视频| 成人国产精品免费网站| 2017欧美狠狠色| 青青草国产成人av片免费| 色哟哟在线观看一区二区三区| 久久嫩草精品久久久久| 美女视频一区二区| 7777精品伊人久久久大香线蕉| 亚洲免费电影在线| 92精品国产成人观看免费| 国产精品久久久久久亚洲伦 | 毛片不卡一区二区| 欧美区在线观看| 亚洲午夜电影网| 在线观看亚洲a| 亚洲一区二区欧美激情| 色偷偷久久人人79超碰人人澡| 日韩码欧中文字| 99久久精品国产网站| 中文字幕第一页久久| 成人高清在线视频| 国产精品视频yy9299一区| 高清国产午夜精品久久久久久| 久久久久久亚洲综合影院红桃 | 精品无人码麻豆乱码1区2区| 日韩欧美三级在线| 国产在线一区二区综合免费视频|