Exemplo n.º 1
0
void driver(VP_INT exinf)
{

    char *ptr;
    char *limit;
    unsigned char c;
    MESSAGE *msg;
    T_MSG *pk_msg;

    while (1) {
        if (SCI1.SSR.BIT.RDRF) {
            c = SCI1.RDR;
            SCI1.SSR.BIT.RDRF = 0;
            while (c == XOFF) {
                while (!SCI1.SSR.BIT.RDRF);
                c = SCI1.RDR;
                SCI1.SSR.BIT.RDRF = 0;
                if (c == XON) break;
            }
        }
        rcv_mbx(MID_TEST,&pk_msg);
        msg = (MESSAGE *)pk_msg;

        ptr = msg->buf;
        limit = &msg->buf[msg->len];
        while (ptr < limit) {
            while (!SCI1.SSR.BIT.TDRE);
            SCI1.TDR = *ptr++;
            SCI1.SSR.BIT.TDRE = 0;
        }
        /* メモリブロック開放 */
        rel_mpf(MPID_TEST,(VP)msg);
    }
}
Exemplo n.º 2
0
/** %jp{表示タスク} */
void Sample_Print(VP_INT exinf)
{
	T_PRINT_MSG *msg;
	
	for ( ; ; )
	{
		rcv_mbx(mbxid, (T_MSG **)&msg);
		Sci1_PutString(msg->text);
		rel_mpf(mpfid, msg);
	}
}