本文整理汇总了C++中os::TEventFlag::Wait方法的典型用法代码示例。如果您正苦于以下问题:C++ TEventFlag::Wait方法的具体用法?C++ TEventFlag::Wait怎么用?C++ TEventFlag::Wait使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类os::TEventFlag
的用法示例。
在下文中一共展示了TEventFlag::Wait方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//---------------------------------------------------------------------------
template<> void TProc1::exec()
{
for(;;)
{
ef.Wait();
}
}
示例2: 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
}
}
示例3: if
void TUART1::Exec()
{
UCSR1A=0x00;
UCSR1B=(1<<RXCIE1)|(1<<RXEN1);
UCSR1C=(1<<UCSZ11)|(1<<UCSZ10);
UBRR1H=0;
UBRR1L=11;
set_uart1_to_receive();
Uart1Counter=0;
for(;;)
{
//#if !UART1_MASTER
if (Uart1Counter==2) {
efUART1.Wait(30);//200
}
else {
efUART1.Wait(10);//200
}
//#endif
if (Uart1Counter==0) {
if (uart_status1&UART_TX_OK) Shota|=UART_TX_OK; else Shota&=~UART_TX_OK;
if (uart_status1&UART_RX_OK) Shota|=UART_RX_OK; else Shota&=~UART_RX_OK;
}
//if (uart_status1&UART_TX_OK) {
// uart_status1&=~UART_TX_OK;
if(uart_status1&UART_RX_OK)
{
uart_status1&=~UART_RX_OK;
NetPackInfo2[Uart1Counter+ZSUV]=0x00;//
switch(Uart1Counter)
{
case 0://типа shafa
{
memcpy( (uint8_t*)&(data_for_slave2.devs_net_stat[0]),
(uint8_t*)&rx_local_buffer1[3],
sizeof(NET_INPUT_STRUCT2)-sizeof(HEAD_NET_STRUCT));
//}
break;
}
case 1://типа кнопки
{
memcpy( (uint8_t*)&(key_data.key[0]),
(uint8_t*)&rx_local_buffer1[3],
sizeof(LCD_INPUT_STRUCT)-sizeof(HEAD_NET_STRUCT));
ProcesFlag|=0x01;
break;
}
case 2:{ //типа мнемосхема
}
break;
}
}
else {
//if (uart_status1&UART_TX_OK) {
// uart_status1&=~UART_TX_OK;
if(NetPackInfo2[Uart1Counter+ZSUV]<12) NetPackInfo2[Uart1Counter+ZSUV]++;
//}
//if(NetPackInfo2[Uart1Counter]<12) NetPackInfo2[Uart1Counter]++;
}
//}
//Uart1Counter=0;
if (Uart1Counter<2)
Uart1Counter++;
else Uart1Counter=0;
//mnemo_counter++;
if (Uart1Counter==2) mnemo_counter++;
//if (mnemo_counter>=3) mnemo_counter=0;
//mnemo_counter=0;
if (mnemo_counter>=NUM_OF_MNEMO) mnemo_counter=0;
if ((NetPackInfo2[0+ZSUV])) PORTC|=_BV(PC1); else PORTC&=~_BV(PC1);
switch(Uart1Counter)
{
case 0: {
memcpy( (uint8_t*)&tx_local_buffer1,
(uint8_t*)&data_from_slave2,
sizeof(NET_OUTPUT_STRUCT2));
cur_address1=0x51;
//cur_address1=data_from_slave1.head.adr;
}
break;
case 1: {
if(tech_fl&SOUND)
{
lcd_data.out_lcd[0]=0x00;
lcd_data.out_lcd[1]=0x44;
}
else {
if(!LCD_light)
{
if (tech_fl&SOUND_KEY){
//.........这里部分代码省略.........