?? io_dce.c
字號:
/* * * Stuff that handles dce IO stuff. * * Copyright (c) 1999 Richard J.M. Close * * Can be freely distributed and used under the terms of the GNU GPL. */#include "io_dce.h"unsigned char io_dce_tx_fifo_empty(void){ unsigned char var1 = 0; if(io_dce_tx_wptr == io_dce_tx_rptr) x_send_mail (0x82, 1, &var1, 1); // Jamie's diss has 83 not 82! return var1;}void io_init_dce_tx_fifo(void){ io_dce_tx_eptr = io_dce_tx_sptr; io_dce_tx_sptr = &io_dce_tx_buff[0]; io_dce_tx_wptr = io_dce_tx_sptr; io_dce_tx_rptr = io_dce_tx_sptr;}void io_init_dce_rx_fifo(void){ io_dce_rx_eptr = io_dce_tx_eptr; io_dce_rx_sptr = &io_dce_rx_buff[0]; io_dce_rx_wptr = io_dce_rx_sptr; io_dce_rx_rptr = io_dce_rx_sptr;}unsigned int io_get_dce_rx_count(void){ unsigned int eax, ecx; ecx = (unsigned int)(io_dce_rx_eptr - io_dce_rx_sptr); ecx = ecx/2; if (io_dce_rx_wptr < io_dce_rx_rptr) goto loc_3AD4C; eax = io_dce_rx_wptr - io_dce_rx_rptr; eax = eax/2; return eax;loc_3AD4C: eax = io_dce_rx_wptr - io_dce_rx_rptr; eax = eax/2; eax = eax + ecx; return eax;}// Transmits a defined number of words.void io_write_dce_fifo (unsigned int count, unsigned short wData){ unsigned int tempCount = count; if (count != 0){ { // Copy data (word) to fifo. *io_dce_tx_wptr = (unsigned char) (wData & 0xff); //LSB io_dce_tx_wptr++; *io_dce_tx_wptr = (unsigned char) (wData / 256); //MSB io_dce_tx_wptr++; // Make sure we are not at end of buffer. if (io_dce_tx_wptr >= io_dce_tx_eptr) // Reached end of tx buffer so reset pointer to start. io_dce_tx_wptr = io_dce_tx_sptr; tempCount--; } while (tempCount > 0); } // Try to transmit the data. io_start_dce_transmit();}void io_start_dce_transmit(void){ printf("io_start_dce_transmit: not yet implemented!");}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -