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

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

?? flag0.c

?? TDK 6521 SOC 芯片 DEMO程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
            break;
        case 'R': // read
            {
                // only copy the data if it's valid, otherwise
                // send a NAK to force a retransmit
                if (!REG_VALID) {
                    xmit_nak (); // char timeout off, msg timeout restarts
                    break;
                }
                if (char_cnt != 0) {
                    char_cnt = min(char_cnt, MAX_CHAR_CNT);
                    data_cnt = (char_cnt + 1)/2;
                    if (address <= 0x7fff) {
                        // registers in xdata memory (CE, etc.)
                        // misbehaves with a zero length
                        memcpy_xce (
                            (int32x_t *)&data_buffer[0],
                            (int32x_t *)address, 
                            ((data_cnt + 3)/4));
                    } else if (address >= 0x8080 && address <= 0x80ff) {
                        uint8_t csfr;
                        address &= 0xff;
                        for(csfr = 0; csfr < data_cnt; ++csfr) {
                            SFR_Read (address + csfr, &t);
                            data_buffer[csfr] = t;
                        }
                    } else { // SFRs (ugh)
                        // registers in idata memory
                        address &= 0xff;
                        for(t = 0; t < data_cnt; ++t) {
                            data_buffer[t] = *(t + ((uint8i_t*)address));
                        }
                    }
                }
                state = STATE_XMIT_DATA;
                msg_ptr = msg_data;
                xmit(); // xmit msg, char timeout off, msg timeout starts
            }
            break;
        case 'W': // write
            {
                // only copy the data if it's valid, otherwise
                // send a NAK to force a retransmit
                if (!REG_VALID) {
                    xmit_nak (); // char timeout off, msg timeout starts
                    break;
                }
                if (char_cnt != 0) {
                    char_cnt = min(char_cnt, MAX_CHAR_CNT);
                    data_cnt = (char_cnt + 1)/2;
                    // write the buffered data
                    if (address <= 0x7fff) {
                        uint8_t xdata *pDst;
                        uint8_t xdata *pSrc;
                        uint8_t cnt = data_cnt;
                        // variables to save interrupt state for a CE transfer
                        CE_XFER_DEFINES;
                        // save a snapshot of the state
                        CE_XFER_SAVE;
                        pDst = (uint8x_t*)address;
                        pSrc = (uint8x_t*)&data_buffer[0];
                        while (cnt != 0) {
                           BEGIN_CE_CRITICAL_SECTION;       // Disable CE interrupts.

                           *((int8x_t *) pDst)  = *((int8x_t *) pSrc);  
                           ++pDst;
                           ++pSrc;
                           --cnt;

                           if (cnt != 0) {
                              *((int8x_t *) pDst)  = *((int8x_t *) pSrc);  
                              ++pDst;
                              ++pSrc;
                              --cnt;
                              }
                           if (cnt != 0)
                              {
                              *((int8x_t *) pDst)  = *((int8x_t *) pSrc);  
                              ++pDst;
                              ++pSrc;
                              --cnt;
                              }
                           if (cnt != 0)
                              {
                              CLK_STRETCH;                     // Change stretch to '6' equivalent.
                              *((int8x_t *) pDst)  = *((int8x_t *) pSrc);  
                              CLK_RELAX;                       // Back to default value.
                              ++pDst;
                              ++pSrc;
                              --cnt;
                              }

                           END_CE_CRITICAL_SECTION;         // Reenable CE interrupts.
                        }
                    // transfer registers to hardware when convenient
                    REG_WRITE = TRUE; // not needed for SFRs
                    } else if (address >= 0x8080 && address <= 0x80ff) {
                        // SFRs (ugh)
                        uint8_t csfr;
                        address &= 0xff;
                        for(csfr = 0; csfr < data_cnt; ++csfr) {
                            SFR_Write (
                                address + csfr, 
                                data_buffer[csfr],
                                ASSIGN);
                        }
                    } else {
                        // registers in idata memory
                        address &= 0xff;
                        for(t = 0; t < data_cnt; ++t) {
                           *(t + ((uint8d_t*)address)) = data_buffer[t];
                        }
                    } // end figure which addressing to use
              } // data exists?
          xmit_ack (); // char timeout off, msg timeout starts
          }
        break;
        } // end switch on command in no-error case
    break;
    } // end switch on error, in command recv state
} // end respond to command
#pragma restore

static code const void (*flag_state_table[STATE_COUNT])(void) small reentrant =
    {
    sign_on, // STATE_XMIT_EMPTY_READOUT, After Y0 is sent
    sign_on, // STATE_XMIT_BREAK, After setting the password (command P1) fails
    get_cmd, // STATE_XMIT_ERR, After an err_msg is sent
    send_id, // STATE_RCV_SIGN_ON, After a sign-on message sent
    rcv_id_ack, // STATE_XMIT_ID, After id is sent, receive the ack
    send_password, // STATE_RCV_ID_ACK, after receiving the ack of the ID
    get_cmd, // STATE_XMIT_PASSWORD_OPERAND, after password data sent
    get_cmd, // STATE_XMIT_DATA, after data is transmitted
    get_cmd, // STATE_XMIT_NAK, after NAK is transmitted
    do_cmd, // STATE_RCV_COMMAND, after a command is received, act on it
    do_cmd_after_ack // STATE_XMIT_ACK; commands to do after sending ACK
    }; // end flag state table

#pragma save
#pragma NOAREGS
// lookup and run the state machine's behavior in the state table
static void flag_state (void) small reentrant
{
    msg_fld_index = 0;
    
    log(1);
    log(state);

    if (state < STATE_LOWER_LIMIT || state > STATE_UPPER_LIMIT)
    {
        sign_on (); // default state, enables receive, turns off timeouts
    }
    else
    {
        (*flag_state_table[state])();
    }

    log(2);
}
#pragma restore

#pragma save
#pragma NOAREGS
// last field
static void end_in (void) small reentrant
{
  --msg_fld_index; // stay in this field forever
}
#pragma restore

#pragma save
#pragma NOAREGS
// field Y- no baud rate negotiation in this version
static void y_in (void) small reentrant
{
  if (cur_char != '1')
  {
      error = max ( error, PasswordBad );
      log(0x85);
      log(error);
  }
}
#pragma restore

#pragma save
#pragma NOAREGS
// do nothing
static void do_nothing (void) small reentrant
{
}
#pragma restore

#pragma save
#pragma NOAREGS
// field C, a command
static void c_in (void) small reentrant
{
   cmd = cur_char;
   // only Break and Password commands work without authorization
   if ((!authorized) && cur_char != 'B' && cur_char != 'P')
   {
      error = max ( error, AuthorizationBad );
      log(0x86);
      log(error);
   }
}
#pragma restore

#pragma save
#pragma NOAREGS
// field D, a command
static void d_in (void) small reentrant
{
    cmd_subtype = cur_char;
    // search for a matching message template
    for(t = MAX_MSG_INDEX; t > 0; --t) {
        msg_ptr = msg_ptr_array[t];
        if ( msg_ptr[CMD_FLD_INDEX] == cmd
           && msg_ptr[CMD_SUBTYPE_FLD_INDEX] == cmd_subtype ) {
            break;
        }
    }
    // if no message template is found, the search ends on the zeroth
    // element of the array, which is an invalid default
    if ( 1 > t || t > MAX_MSG_INDEX )
    {
        error = max ( error, CommandBad );
        log(0x87);
        log(error);
    }
}
#pragma restore

#pragma save
#pragma NOAREGS
// field device address, ignore hexadecimal device address
static void device_address_in (void) small reentrant
{
    if (msg_fld_next == cur_char) // look for the end of the field
        ++msg_fld_index; // skip field and ending character
    else
        --msg_fld_index; // stay in this field until the digits are done
}
#pragma restore

#pragma save
#pragma NOAREGS
// field data address,
static void data_address_in (void) small reentrant
{
    --msg_fld_index; // stay in this field until the digits are done
    if (cur_char >= '0' && cur_char <= '9') {
        t = cur_char - '0';    
    } else if (cur_char >= 'A' && cur_char <= 'F') {
        t = cur_char - ('A' - 10);    
    } else if (cur_char >= 'a' && cur_char <= 'f') {
        t = cur_char - ('a' - 10);    
    } else {
        // the next character was not hex
        if (msg_fld_next != cur_char) { // look for the end of the field
            error = max ( error, DataBad );
            log(0x88);
            log(error);
            data_bit_index = 0;
        }
        // cope with the end of the field
        msg_fld_index += 2; // digits done, next char checked
    return;
    }
    // cope with a normal hex value
    address = t + (address << 4);
}
#pragma restore

#pragma save
#pragma NOAREGS
// field data count,
static void data_count_in (void) small reentrant
{
    --msg_fld_index; // stay in this field until the digits are done
    if (cur_char >= '0' && cur_char <= '9') {
        t = cur_char - '0';    
    } else if (cur_char >= 'A' && cur_char <= 'F') {
        t = cur_char - ('A' - 10);    
    } else if (cur_char >= 'a' && cur_char <= 'f') {
        t = cur_char - ('a' - 10);    
    } else {
        // the next character was not hex
        if (msg_fld_next != cur_char) { // look for the end of the field
            error = max ( error, DataBad );
            log(0x89);
            log(error);
            data_bit_index = 0;
        }
        if (char_cnt > MAX_CHAR_CNT) { // look for the end of the field
            error = max ( error, DataBad );
            log(0x8a);
            log(error);
            char_cnt = MAX_CHAR_CNT;
        }
        msg_fld_index += 2; // digits done, next char checked
        return;
    }
    // cope with a normal hex value
    char_cnt = t + (char_cnt << 4);
}
#pragma restore

#pragma save
#pragma NOAREGS
// field ,
static void hex_data_in (void) small reentrant
{
    --msg_fld_index; // stay in this field until the digits are done
    t = 0xff;
    if (cur_char >= '0' && cur_char <= '9') {
        t = cur_char - '0';    
    } else if (cur_char >= 'A' && cur_char <= 'F') {
        t = cur_char - ('A' - 10);    
    } else if (cur_char >= 'a' && cur_char <= 'f') {
        t = cur_char - ('a' - 10);    
    } else {
        // the next character was not hex
        if (msg_fld_next != cur_char) { // look for the end of the field
            error = max ( error, DataBad );
            log(0x8b);
            log(error);
            data_bit_index = 0;
        }
        // cope with the end of the field
        if (data_bit_index != 0) {
            error = max(error,DataBad);
            log(0x8c);
            log(error);
            data_bit_index = 0;
        }
        msg_fld_index += 2; // digits done, next char checked
        return; 
    }
    // cope with a normal hex value
    char_cnt += 1;
    if (data_bit_index == 4) {
        hex_byte = t | hex_byte;
        data_bit_index = 0;
        data_buffer[data_index++] = hex_byte;
        if (data_index > MAX_DATA_INDEX)
           data_index = MAX_DATA_INDEX;
    } else {
        hex_byte = t << 4;
        data_bit_index = 4;
    }
}
#pragma restore

#pragma save
#pragma NOAREGS
// field BEGIN_BCC, indicate the start of the data 
// tested by the bcc (block check character)
static void begin_bcc_in (void) small reentrant
{
    bcc = cur_char;
}
#pragma restore

#pragma save
#pragma NOAREGS
// field BCC, check the bcc (block check character)
static void bcc_in (void) small reentrant
{
    if (bcc != 0)
    {
        error = max(error,ChecksumBad);
        log(0x8d);
        log(error);
    }
}
#pragma restore

// start of logic that reads characters from an input port, and
// interprets them as a flag message
static code const void (* flag_in_state_table[MSG_FLD_COUNT])(void) small reentrant =
    {
    end_in, // END: last field- do not increment field pointer
    do_nothing, // field z- baud rate negotiation
    y_in, // field Y- baud rate negotiation
    c_in, // field c- command
    d_in, // field d- command subtype
    device_address_in, // DEVICE_ADDRESS: ignore a hexadecimal device address
    data_address_in, // DATA_ADDRESS: hexadecimal data address
    data_count_in, // DATA_COUNT: hexadecimal data count
    hex_data_in, // HEX_DATA: a string of bytes in hex.
    begin_bcc_in, // BEGIN_BCC: start of data protected by a BCC.
    bcc_in, // BCC: check the bcc (block check character).
    do_nothing // ERROR: do nothing.
    };

/* run a flag state machine for serial port input */
// This works by stepping through the current message template.
#pragma save
#pragma NOAREGS
#if PORT==0
void flag0_in (void) small reentrant
#endif
#if PORT==1
void flag1_in (void) small reentrant
#endif
{
    log(3);
    log(msg_fld_index);

    cur_char = ser_rcv();  // receive a byte
    bcc ^= cur_char;       // calculate the bcc
    // the hardware level state machine
    if ( ser_rcv_err() ) {
        error = ParityBad;
        log(0x8e);
        log(error);
        ser_clr_err();
    }
    #if TIMERS
    reset_char_timer ();
    #endif

    // the character level state machine
    // It reads fields in message templates and interprets them.
    // The message templates are selected by the
    // protocol-level flag state machine.
    do {
        msg_fld = *(msg_ptr + msg_fld_index);
        ++msg_fld_index;  // automatically step to the next field
        msg_fld_next = *(msg_ptr + msg_fld_index );

        // if it's not an executable field value
        if (msg_fld < MSG_FLD_LOWER_LIMIT 
            || msg_fld > MSG_FLD_UPPER_LIMIT)
        {
            // the input should be the same as the template
            if (msg_fld != cur_char) {
                if (msg_ptr == msg_P1) {
                    error = max(error,PasswordBad);
            log(0x8f);
            log(error);
                } else {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.一区二区| 国产精品亚洲午夜一区二区三区 | 欧美一区中文字幕| 欧美激情一区在线观看| 日韩二区三区在线观看| av色综合久久天堂av综合| 日韩欧美成人午夜| 亚洲国产一区二区三区青草影视| 国产99久久久精品| 欧美肥大bbwbbw高潮| ㊣最新国产の精品bt伙计久久| 视频一区视频二区中文字幕| 94-欧美-setu| 国产日韩欧美激情| 伦理电影国产精品| 欧美日韩国产免费一区二区| 亚洲另类色综合网站| 成人综合婷婷国产精品久久蜜臀 | 日韩一区二区三区在线观看| 亚洲精品高清在线| 成人免费视频一区二区| 精品奇米国产一区二区三区| 亚洲成人免费av| 99精品在线观看视频| 国产日韩欧美不卡| 国产一区二区伦理片| 日韩欧美亚洲国产精品字幕久久久| 亚洲黄色在线视频| 91在线porny国产在线看| 国产色产综合产在线视频| 精品制服美女久久| 一区二区三区波多野结衣在线观看| 成人av在线看| 国产女主播视频一区二区| 久久成人av少妇免费| 欧美一级在线免费| 日韩中文字幕区一区有砖一区 | 国产麻豆精品theporn| 欧美一区二区三区免费观看视频| 一区二区三区产品免费精品久久75| youjizz国产精品| 日本一区二区动态图| 国产精品综合av一区二区国产馆| 精品日韩成人av| 久草热8精品视频在线观看| 欧美精品粉嫩高潮一区二区| 亚欧色一区w666天堂| 欧美日韩国产天堂| 日韩精品每日更新| 日韩一级黄色片| 免费成人深夜小野草| 欧美成人vr18sexvr| 国产一区二区三区日韩| 久久久久久电影| 国产麻豆精品久久一二三| 国产亚洲美州欧州综合国| 国产精品99久久久久久有的能看 | 欧美丝袜丝交足nylons图片| 亚洲一区二区三区四区五区中文| 91国偷自产一区二区开放时间| 亚洲欧美日韩国产综合| 91福利社在线观看| 亚洲一区二区三区四区在线免费观看 | 日精品一区二区| 日韩亚洲欧美高清| 国产精品一线二线三线| 中文一区在线播放| 91美女视频网站| 亚洲高清视频的网址| 日韩欧美一二三| 国产成人免费av在线| 中文字幕一区二区视频| 色94色欧美sute亚洲线路一ni| 亚洲成人av中文| 精品少妇一区二区三区视频免付费 | 日韩一区二区免费电影| 国产一区二区三区免费观看| 久久精品亚洲麻豆av一区二区 | 久久精品国产成人一区二区三区 | 亚洲美女电影在线| 欧美在线观看18| 青青草国产精品亚洲专区无| 国产亚洲一区二区三区四区| 91在线观看美女| 午夜精品久久久久久久久久| 精品国产不卡一区二区三区| 成人黄色在线网站| 亚洲一区在线视频| 精品国产乱码久久久久久闺蜜| 成人午夜激情片| 亚洲永久免费视频| 精品国产1区2区3区| 99热在这里有精品免费| 日韩精品午夜视频| 国产午夜精品久久| 欧美日韩精品福利| 国产精品123区| 亚洲一区二区三区自拍| 2021久久国产精品不只是精品| 波多野结衣欧美| 午夜精品福利一区二区蜜股av| 国产日韩精品一区二区浪潮av| 色诱亚洲精品久久久久久| 精品一区二区三区视频在线观看| 国产精品国产精品国产专区不蜜| 欧美一级高清片| zzijzzij亚洲日本少妇熟睡| 美国十次了思思久久精品导航| 国产精品免费人成网站| 在线播放视频一区| 成人黄页毛片网站| 久久精品国产亚洲高清剧情介绍| ㊣最新国产の精品bt伙计久久| 日韩一级二级三级| 色欧美片视频在线观看在线视频| 狠狠色狠狠色综合系列| 亚洲永久免费视频| 国产精品欧美久久久久无广告 | 在线视频一区二区三| 国产精品小仙女| 蜜臀av性久久久久蜜臀aⅴ| 亚洲欧洲综合另类| 国产亚洲精品aa| 日韩视频一区二区| 在线中文字幕一区| 大陆成人av片| 狠狠色丁香婷综合久久| 亚洲不卡av一区二区三区| 国产精品久久久久久久岛一牛影视 | 国产在线不卡一区| 天堂影院一区二区| 一区二区三区在线影院| 国产精品乱人伦| 久久免费美女视频| 欧美sm极限捆绑bd| 91精品国产一区二区三区香蕉| 色88888久久久久久影院按摩| 丰满少妇久久久久久久| 韩国精品一区二区| 蜜臀99久久精品久久久久久软件| 一区二区三区精品视频| 亚洲特级片在线| 国产精品私人影院| 久久精子c满五个校花| 久久一二三国产| 日韩精品中文字幕在线不卡尤物| 在线观看91av| 欧美美女视频在线观看| 欧美亚洲动漫精品| 欧美亚洲另类激情小说| 色婷婷av一区二区三区软件| 成人app软件下载大全免费| 国产成人在线视频免费播放| 国产综合久久久久久久久久久久 | 亚洲国产岛国毛片在线| 久久麻豆一区二区| 精品盗摄一区二区三区| 欧美成人一区二区三区在线观看| 欧美大胆一级视频| 日韩亚洲欧美成人一区| 日韩欧美国产小视频| 欧美一区二区三区系列电影| 51精品视频一区二区三区| 欧美日韩高清影院| 欧美一区二区在线免费观看| 欧美一区二区三区视频免费| 91精品国产色综合久久ai换脸| 欧美精品 日韩| 欧美一级欧美一级在线播放| 欧美不卡在线视频| 久久久久久**毛片大全| 国产日韩精品视频一区| 亚洲国产精品v| 最新日韩在线视频| 亚洲一区视频在线观看视频| 亚洲国产欧美在线人成| 免费观看一级欧美片| 精品一区二区三区蜜桃| 国产精品2024| 成人免费看视频| 91在线看国产| 欧美另类一区二区三区| 日韩一二三区视频| 国产午夜精品一区二区| 亚洲日本一区二区| 亚洲第一成人在线| 青青草成人在线观看| 国产成人自拍网| 91麻豆产精品久久久久久 | 国产黄色精品网站| hitomi一区二区三区精品| 色94色欧美sute亚洲线路一久| 欧美麻豆精品久久久久久| 精品久久人人做人人爱| 国产精品丝袜91| 亚洲精品免费播放| 奇米精品一区二区三区在线观看| 激情小说欧美图片| 色综合网站在线| 91麻豆精品国产91久久久 |