/* * シリアルI/Oポート割込みハンドラ */ void sio_handler(void) { int port; for(port = 0; port < TNUM_PORT; ++ port) { if(BITTEST(siopcb_table[port].Flag, SIO_STA_OPEN)) { /* 受信完了割込み */ if(BITTEST(siopcb_table[port].Flag, SIO_STA_INTRCV)) { /* 受信した文字を取り出し */ BITCLEAR(siopcb_table[port].Flag, SIO_STA_INTRCV); sio_ierdy_rcv(GET_SIOPCB(ID_PORT(port))->exinf); } /* 送信完了割込み */ if(BITTEST(siopcb_table[port].Flag, SIO_STA_INTSND)) { BITCLEAR(siopcb_table[port].Flag, SIO_STA_INTSND); sio_ierdy_snd(GET_SIOPCB(ID_PORT(port))->exinf); } } } }
/* * SIOの割込みハンドラ */ void sio_handler(void) { /* * 全てのポートについてチェック */ ID portid ; for ( portid = 0 ; portid < TNUM_PORT ; portid++ ) { SIOPCB *siopcb = &siopcb_table[portid] ; UH uhBase = siopcb->uhBase ; /* * 送信完了割り込みか */ if ( ( __SFR(uhBase) & ( __UxCR_TXIE | __UxCR_TXEMPTY ) ) == ( __UxCR_TXIE | __UxCR_TXEMPTY ) ) { sio_ierdy_snd( siopcb->vpiExinf ) ; } /* * 受信割り込みか */ if ( ( __SFR(uhBase) & ( __UxCR_RXIE | __UxCR_RXREADY ) ) == ( __UxCR_RXIE | __UxCR_RXREADY ) ) { sio_ierdy_rcv( siopcb->vpiExinf ) ; } } }
void sio_handler_in(void) { int port; for(port = 0; port < TNUM_PORT; ++ port) { if( hw_port_getready(&siopcb_table[port]) == TRUE ) sio_ierdy_rcv(GET_SIOPCB(ID_PORT(port))->exinf); } }