Пример #1
0
//---------------------------------------------------------------------------
template<> void TTerminalProc::exec()
{
    sleep(1000);
    
    for(;;)
    {
    LBegin:
        NewLineIncoming.wait();
        uint16_t n = strcspn(RxBuf, " \0");
        if(n == 0)
        {
            UART::send("\n\n");
            continue;
        }
        strncpy(command, RxBuf, n);
        command[n] = 0;
        for(uint16_t i = 0; i < sizeof(command_dict)/sizeof(command_dict[0]); i++)
        {
            if(strcmp(command, command_dict[i]) == 0)
            {
                UART::send("... Ok\r");
                char *s = RxBuf + n + 1;
                (*fptr[i])(s);
                goto LBegin;
            }
        }
        UART::send("... error: unknown command\r");
    }
}
Пример #2
0
//---------------------------------------------------------------------------
template<> OS_PROCESS void TProc1::exec()
{
    for(;;)
    {
        ef.wait();
    }     
}
Пример #3
0
//---------------------------------------------------------------------------
template<> OS_PROCESS void TProc2::exec()
{
    for(;;)
    {
        Timer_B_Ovf.wait();
    }
}
//---------------------------------------------------------------------------
template<> void TProc1::exec()
{
    for(;;)
    {
        ef.wait();
    }     
}
Пример #5
0
//---------------------------------------------------------------------------
template<> OS_PROCESS void TProc1::exec()
{
    for(;;)
    {
        Timer_Flag.wait();
        SlonQueue.push(&African);
    }     
}
//---------------------------------------------------------------------------
template<> void TProc2::exec()
{
    for(;;)
    {
        ef.wait();
        MMR16(FIO_FLAG_C) = (1 << 8);
    }
}
//---------------------------------------------------------------------------
template<> void TProc1::exec()
{
    for(;;)
    {
        ef_timer0.wait();
        MMR16(FIO_FLAG_C) = (1 << 9);
    }
}
//---------------------------------------------------------------------------
template<> void TProc2::exec()
{
    for(;;)
    {
        Timer_B_Ovf.wait();
        P1OUT &= ~(1 << 4);
    }
}
//---------------------------------------------------------------------------
template<> void TProc1::exec()
{
    for(;;)
    {
        Timer1_Ovf.wait();
        SlonQueue.push(&African);
    }
}
//---------------------------------------------------------------------------
template<> void TProc2::exec()
{
    for(;;)
    {
        ef.wait();
        MMR16(FIO_FLAG_C) = (1 << 8);
        for(int i = 0; i < 100000; ++i)
        {
            asm( " nop;");
        }
    }
}
template<> void TProc2::exec()
{
	 for(;;)
	    {
		 ef.wait();
		 for(int i = 0; i < 100000; ++i)
		        {
		            asm( " nop;");
		        }
	    }

}