示例#1
0
template<> void TProc1::exec()
{

    for(;;)
    {
        //--------------------------------------------------
        //
        //            Message test
        //
        //
        //     Receive data as message
        //
        MamontMsg.wait();                                     // wait for message
        MamontMsg.out(Mamont);                                // read message content to global test object
        if(Mamont.src == TMamont::PROC_SRC)
        {
        	*pREG_PORTG_DATA_TGL=0x8000;
        }
        else
        {
        	*pREG_PORTG_DATA_TGL=0x4000;
        }
    }

}
示例#2
0
//---------------------------------------------------------------------------
template<> void TProc1::exec()
{
    for(;;)
    {
        //--------------------------------------------------
        //
        //            Message test
        //
        //
        //     Receive data as message
        //
        MamontMsg.wait();                                     // wait for message
        MamontMsg.out(Mamont);                                // read message content to global test object 
        if(Mamont.src == TMamont::PROC_SRC)
        {
            P1OUT &= ~(1 << 4);
        }
        else
        {
            P1OUT &= ~(1 << 4);
            P1OUT |= (1 << 4);
            P1OUT &= ~(1 << 4);
        }
    }     
}
示例#3
0
static void TimerHandler(void *pCBParam, uint32_t Event, void *pArg)
{
   switch(Event)
    {
        case ADI_TMR_EVENT_DATA_INT:{

        	OS::TISRW ISR;
        	  //--------------------------------------------------
        	    //
        	    //            Message test
        	    //
        	    //     Send data as message
        	    //
        	    TMamont m;                     // create message content

        	    m.src  = TMamont::ISR_SRC;
        	    m.data = 10;
        	    MamontMsg = m;                 // put the content to the OS::message object
        	    MamontMsg.send_isr();          // send the message


            break;
        }
        default:
            break;
    }

}
//---------------------------------------------------------------------------
template<> OS_PROCESS void TProc3::exec()
{
    for(;;)
    {
        sleep(1);
        TMamont m;           // create message content

        m.src  = TMamont::PROC_SRC;
        m.data = 5;
        MamontMsg = m;       // put the content to the OS::message object
        MamontMsg.send();    // send the message
    }
}
//---------------------------------------------------------------------------
template<> OS_PROCESS void TProc1::exec()
{
    for(;;)
    {
        //--------------------------------------------------
        //
        //            Message test
        //
        //
        //     Receive data as message
        //
        MamontMsg.wait();          // wait for message
        MamontMsg.out(Mamont);     // read message content to global test object 
        if(Mamont.src == TMamont::PROC_SRC)
        {
            ; // Make some actions
        }
        else
        {
            ; // Make some actions
        }
    }     
}
//---------------------------------------------------------------------------
void OS::system_timer_user_hook()
{
    //--------------------------------------------------
    //
    //            Message test
    //
    //     Send data as message
    //
    TMamont m;           // create message content

    m.src  = TMamont::ISR_SRC;
    m.data = 10;
    MamontMsg = m;           // put the content to the OS::message object
    MamontMsg.send_isr();    // send the message
}
示例#7
0
//---------------------------------------------------------------------------
interrupt(TIMERB0_VECTOR) Timer_B_ISR()
{
    OS::TISRW ISRW;

    ENABLE_NESTED_INTERRUPTS();

    //--------------------------------------------------
    //
    //            Message test
    //
    //     Send data as message
    //
    TMamont m;           // create message content

    m.src  = TMamont::ISR_SRC;
    m.data = 10;
    MamontMsg = m;       // put the content to the OS::message object
    P1OUT |= (1 << 4);
    MamontMsg.send_isr();    // send the message
}
示例#8
0
void OS::system_timer_user_hook()
{
	static int timer_event_counter = 5;
	if (!--timer_event_counter)
	{
		timer_event_counter = 5;
	    //--------------------------------------------------
	    //
	    //            Message test
	    //
	    //     Send data as message
	    //
	    TMamont m;           // create message content

	    m.src  = TMamont::ISR_SRC;
	    m.data = 10;
	    MamontMsg = m;       // put the content to the OS::message object
        LED0.On();
	    MamontMsg.send_isr();    // send the message
	}
}
示例#9
0
//---------------------------------------------------------------------------
OS_INTERRUPT void Timer_ISR()
{
    OS::TISRW ISRW;
    T1IR = 0xFF; // T1IR;                    // clear int flag

    //--------------------------------------------------
    //
    //            Message test
    //
    //     Send data as message
    //
    TMamont m;           // create message content

    m.src  = TMamont::ISR_SRC;
    m.data = 10;
    MamontMsg = m;       // put the content to the OS::message object
    FIO0SET = (1<<2);
    MamontMsg.sendISR();    // send the message


    VICVectAddr = 0;    // Reset VIC logic
}