本文整理汇总了C++中os::TEventFlag类的典型用法代码示例。如果您正苦于以下问题:C++ TEventFlag类的具体用法?C++ TEventFlag怎么用?C++ TEventFlag使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TEventFlag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//---------------------------------------------------------------------------
template<> OS_PROCESS void TProc2::exec()
{
for(;;)
{
Timer_B_Ovf.wait();
}
}
示例2:
OS_INTERRUPT void Uart0Rx_ISR()
{
OS_ISR_ENTER();
_CLI();
uint8_t ret_val;
ret_val=Receive_buffer_uart0(cur_address0);
switch(ret_val)
{
case 2:
{
UCSR0B=0;
#if !UART0_MASTER
efUART0.Signal();
#endif
break;
}
case 3:
{
uart_status0|=UART_RX_OK;
uart_init0();
#if !UART0_MASTER
set_uart0_to_transmitt();
UCSR0B&=~(1<<RXEN0)|(1<<RXCIE0);
UCSR0B=(1<<TXEN0)|(1<<TXCIE0); //разрешение передатчика
//set_uart0_to_transmitt();
UDR0='!';
#endif
break;
}
}
OS_ISR_EXIT();
}
示例3:
//---------------------------------------------------------------------------
template<> void TProc1::exec()
{
for(;;)
{
ef.Wait();
}
}
示例4: sleep
//---------------------------------------------------------------------------
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");
}
}
示例5: sleep
//---------------------------------------------------------------------------
template<> void TProc3::exec()
{
for(;;)
{
sleep(2);
ef.signal();
}
}
示例6:
//---------------------------------------------------------------------------
template<> void TProc2::exec()
{
for(;;)
{
ef.wait();
MMR16(FIO_FLAG_C) = (1 << 8);
}
}
示例7:
//---------------------------------------------------------------------------
template<> OS_PROCESS void TProc1::exec()
{
for(;;)
{
Timer_Flag.wait();
SlonQueue.push(&African);
}
}
示例8:
OS_INTERRUPT void Timer1_period_ISR()
{
OS::TISRW_SS ISRW;
ENABLE_NESTED_INTERRUPTS();
Timer1_Ovf.signal_isr();
}
示例9: memcpy
void TUART0::Exec()
{
UCSR0A=0x00;
UCSR0B=(1<<RXCIE0)|(1<<RXEN0);
UCSR0C=(1<<UCSZ01)|(1<<UCSZ00);
UBRR0H=0;
UBRR0L=11;
cur_net_pack=0;
set_uart0_to_receive();
for(;;)
{
//PORTC|=_BV(PC1);
// #if !UART0_MASTER
efUART0.Wait(150);
// #endif
set_uart0_to_receive();
if(uart_status0&UART_RX_OK)
{
uiNetCounter=0;
PORTC&=~_BV(PC1); //Блималка при гарному пакеті
uart_status0&=~UART_RX_OK;
//----------------------------------------------------------------------------
memcpy( (uint8_t*)&(data_for_slave1.devs_net_cmd[0]),
(uint8_t*)&rx_local_buffer0[3],
sizeof(NET_INPUT_STRUCT1)-sizeof(HEAD_NET_STRUCT));
//----------------------------------------------------------------------------
}
else {
PORTC|=_BV(PC1);
if (uiNetCounter<60) uiNetCounter++;
// UCSR0B=(1<<RXEN0)|(1<<RXCIE0);
}
uart_status0=0;
uart_init0();
set_uart0_to_receive();
//---------------------------------------------------------------------------------------
//Mutex1.Lock();
memcpy((uint8_t*)&tx_local_buffer0,
(uint8_t*)&data_from_slave1,
sizeof(NET_OUTPUT_STRUCT1));
cur_address0=data_for_slave1.head.adr;
//Mutex1.Unlock();
//---------------------------------------------------------------------------------------
#if UART0_MASTER
UCSR0B=(1<<TXEN0)|(1<<TXCIE0); //разрешение передатчика
set_uart0_to_transmitt();
_delay_us(100);
UDR0='#';
#else
UCSR0B=(1<<RXEN0)|(1<<RXCIE0);
#endif
Sleep(20);//7//10.37ms //BULO 50
}
}
示例10: Timer_B_ISR
OS_INTERRUPT void Timer_B_ISR()
{
OS::TISRW ISRW;
ENABLE_NESTED_INTERRUPTS();
P1OUT |= (1 << 4);
Timer_B_Ovf.SignalISR();
}
示例11:
template<> void TProc1::exec()
{
for(;;)
{
ef_timer0.wait();
}
}
示例12: sleep
//---------------------------------------------------------------------------
template<> void TProc3::exec()
{
for(;;)
{
sleep(3);
MMR16(FIO_FLAG_S) = (1 << 8);
ef.signal();
}
}
示例13: system_timer_user_hook
//---------------------------------------------------------------------------
void OS::system_timer_user_hook()
{
static int cnt=0;
if (++cnt == 25)
{
cnt = 0;
Timer_B_Ovf.signal_isr();
}
}
示例14: system_timer_user_hook
void OS::system_timer_user_hook()
{
static int timer_event_counter = 5;
if (!--timer_event_counter)
{
timer_event_counter = 5;
LED1.On();
TimerEvent.signal_isr();
}
}
示例15: Timer_ISR
OS_INTERRUPT void Timer_ISR()
{
OS::TISRW ISRW;
T1IR = T1IR; // clear int flag
IOCLR0 = (1 << 10);
TimerEvent.signal_isr();
IRQ_DONE();
}