本文整理汇总了C++中HAL_COMPLETION类的典型用法代码示例。如果您正苦于以下问题:C++ HAL_COMPLETION类的具体用法?C++ HAL_COMPLETION怎么用?C++ HAL_COMPLETION使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HAL_COMPLETION类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NATIVE_PROFILE_PAL_ASYNC_PROC_CALL
void HAL_COMPLETION::EnqueueTicks( UINT64 EventTimeTicks )
{
NATIVE_PROFILE_PAL_ASYNC_PROC_CALL();
ASSERT(EventTimeTicks != 0);
GLOBAL_LOCK(irq);
this->EventTimeTicks = EventTimeTicks;
#if defined(_DEBUG)
this->Start_RTC_Ticks = HAL_Time_CurrentTicks();
#endif
HAL_COMPLETION* ptr = (HAL_COMPLETION*)g_HAL_Completion_List.FirstNode();
HAL_COMPLETION* ptrNext;
for(;(ptrNext = (HAL_COMPLETION*)ptr->Next()); ptr = ptrNext)
{
if(EventTimeTicks < ptr->EventTimeTicks) break;
}
g_HAL_Completion_List.InsertBeforeNode( ptr, this );
if(this == g_HAL_Completion_List.FirstNode())
{
HAL_Time_SetCompare( EventTimeTicks );
}
}
示例2: while
BOOL TEvents::TEvents_1()
{
UINT32 count = 100;
UINT32 signaled;
HAL_COMPLETION compObj;
compObj.InitializeForISR(CompletionCallback, NULL);
while (count--)
{
compObj.EnqueueDelta(1000*2);
signaled = Events_WaitForEvents(s_event,50);
if (signaled != s_event)
{
return false;
}
}
return true;
}
示例3: InitContinuations
void InitContinuations( struct netif *pNetIf )
{
InterruptTaskContinuation.InitializeCallback( (HAL_CALLBACK_FPN)STM32F4_ETH_LWIP_recv, (void*)pNetIf );
LwipUpTimeCompletion.InitializeForUserMode( (HAL_CALLBACK_FPN)lwip_network_uptime_completion, (void*)pNetIf );
LwipUpTimeCompletion.EnqueueDelta64( 2000000 );
}
示例4: InitContinuations
void InitContinuations( struct netif *pNetIf )
{
InterruptTaskContinuation.InitializeCallback( (HAL_CALLBACK_FPN)LPC24XX_EMAC_lwip_recv, pNetIf );
LwipUpTimeCompletion.InitializeForUserMode( (HAL_CALLBACK_FPN)lwip_network_uptime_completion, pNetIf );
LwipUpTimeCompletion.EnqueueDelta64( 2000000 );
}
示例5: InitContinuations
void InitContinuations( struct netif* pNetIf )
{
InterruptTaskContinuation.InitializeCallback( (HAL_CALLBACK_FPN)enc28j60_lwip_interrupt, &g_ENC28J60_NetIF );
LwipUpTimeCompletion.InitializeForUserMode( (HAL_CALLBACK_FPN)lwip_network_uptime_completion, pNetIf );
LwipUpTimeCompletion.EnqueueDelta64( 500000 );
}
示例6: rtp_thread_spawn
/*----------------------------------------------------------------------*
rtp_thread_spawn
*----------------------------------------------------------------------*/
int rtp_thread_spawn (RTP_HANDLE * newThread,
RTP_ENTRY_POINT_FN entryPoint,
const char * name,
int stackSizeIndex,
int priorityIndex,
void * userData)
{
PIFACE pi;
int * index = (int *) userData;
if ((rtp_strcmp(name, "ip interpret") == 0) && !IPTaskInitialized[*index])
{
IPTaskInitialized[*index] = 1;
IPTaskContinuation[*index].InitializeCallback((HAL_CALLBACK_FPN) entryPoint, userData);
}
else if ((rtp_strcmp(name, "timer comp") == 0) && !TimerTaskCompInitialized)
{
TimerTaskCompInitialized = 1;
TimerTaskCompletion.InitializeForUserMode((HAL_CALLBACK_FPN) entryPoint, userData);
TimerTaskCompletion.EnqueueDelta(cfg_protocol_data.timer_freq * 1000);
}
else if ((rtp_strcmp(name, "timer cont") == 0) && !TimerTaskContInitialized)
{
TimerTaskContInitialized = 1;
TimerTaskContinuation.InitializeCallback((HAL_CALLBACK_FPN) entryPoint,userData);
}
else if ((rtp_strcmp(name, "interrupt task") == 0) && !InterruptTaskContInitialized[*index])
{
pi = (PIFACE) &ifaces[*index];
if (!pi)
{
return -1;
}
InterruptTaskContInitialized[*index] = 1;
InterruptTaskContinuation[*index].InitializeCallback((HAL_CALLBACK_FPN) entryPoint,pi);
}
else if ((rtp_strcmp(name, "dhcp") == 0) && !DHCPTaskInitialized)
{
DHCPTaskInitialized = 1;
DHCPTaskContinuation.InitializeCallback((HAL_CALLBACK_FPN) entryPoint,userData);
}
return (0);
}
示例7: Events_SetBoolTimer
void Events_SetBoolTimer( BOOL* TimerCompleteFlag, UINT32 MillisecondsFromNow )
{
NATIVE_PROFILE_PAL_EVENTS();
// we assume only 1 can be active, abort previous just in case
g_Events_BoolTimerCompletion.Abort();
if(TimerCompleteFlag)
{
g_Events_BoolTimerCompletion.InitializeForISR( local_Events_SetBoolTimer_Callback, TimerCompleteFlag );
g_Events_BoolTimerCompletion.EnqueueDelta( MillisecondsFromNow * 1000 );
}
}
示例8: memset
BOOL ENC28J60_LWIP_Driver::Close( ENC28J60_LWIP_DRIVER_CONFIG* config, int index )
{
NATIVE_PROFILE_HAL_DRIVERS_ETHERNET();
if(config == NULL) return FALSE;
LwipUpTimeCompletion.Abort();
netif_set_link_down( &g_ENC28J60_NetIF );
netif_set_down( &g_ENC28J60_NetIF );
netif_remove( &g_ENC28J60_NetIF );
/* Disable the INTERRUPT pin */
CPU_GPIO_EnableInputPin2(config->INT_Pin,
FALSE, /* Glitch filter enable */
NULL, /* ISR */
0, /* minor number */
GPIO_INT_NONE, /* Interrupt edge */
RESISTOR_PULLUP); /* Resistor State */
InterruptTaskContinuation.Abort();
LwipNetworkStatus = FALSE;
enc28j60_lwip_close( &g_ENC28J60_NetIF );
memset(&g_ENC28J60_NetIF, 0, sizeof(g_ENC28J60_NetIF));
return TRUE;
}
示例9: lwip_network_uptime_completion
void lwip_network_uptime_completion(void *arg)
{
NATIVE_PROFILE_PAL_NETWORK();
BOOL status = ENET_PHY_lwip_get_link_status( );
if(status != LwipNetworkStatus)
{
struct netif* pNetIf = (struct netif*)arg;
if(status)
{
SOCK_NetworkConfiguration *pNetCfg = &g_NetworkConfig.NetworkInterfaces[0];
ENET_PHY_lwip_set_link_speed( );
netif_set_up( pNetIf );
if(pNetCfg->flags & SOCK_NETWORKCONFIGURATION_FLAGS_DHCP)
{
dhcp_start( pNetIf );
}
Network_PostEvent( NETWORK_EVENT_TYPE__AVAILABILITY_CHANGED, NETWORK_EVENT_FLAGS_IS_AVAILABLE );
}
else
{
netif_set_down( (struct netif*)arg );
Network_PostEvent( NETWORK_EVENT_TYPE__AVAILABILITY_CHANGED, 0);
}
LwipNetworkStatus = status;
}
LwipUpTimeCompletion.EnqueueDelta64( 2000000 );
}
示例10: lwip_network_uptime_completion
void lwip_network_uptime_completion(void *arg)
{
NATIVE_PROFILE_PAL_NETWORK();
struct netif* pNetIf = (struct netif*)arg;
BOOL status = enc28j60_get_link_status(&g_ENC28J60_LWIP_Config.DeviceConfigs[0].SPI_Config);
if(status != LwipNetworkStatus)
{
if(status)
{
tcpip_callback((sys_timeout_handler)netif_set_link_up, (void*)pNetIf);
tcpip_callback((sys_timeout_handler)netif_set_up, (void*)pNetIf);
Network_PostEvent( NETWORK_EVENT_TYPE__AVAILABILITY_CHANGED, NETWORK_EVENT_FLAGS_IS_AVAILABLE );
}
else
{
tcpip_callback((sys_timeout_handler)netif_set_link_down, (void*)pNetIf);
tcpip_callback((sys_timeout_handler)netif_set_down, (void*)pNetIf);
Network_PostEvent( NETWORK_EVENT_TYPE__AVAILABILITY_CHANGED, 0);
}
Events_Set(SYSTEM_EVENT_FLAG_SOCKET);
Events_Set(SYSTEM_EVENT_FLAG_NETWORK);
LwipNetworkStatus = status;
}
LwipUpTimeCompletion.EnqueueDelta64( 2000000 );
}
示例11: Events_Initialize
BOOL Events_Initialize()
{
NATIVE_PROFILE_PAL_EVENTS();
g_Events_BoolTimerCompletion.Initialize();
SystemEvents = 0;
return TRUE;
}
示例12: LargeBuffer_ManagedToNative
void LargeBuffer_ManagedToNative( UINT16 marshalId, const BYTE* pData, size_t size )
{
if(!g_LargeBufferCompletionInit)
{
g_LargeBufferTestCompletion.InitializeForUserMode(LargeBufferTest_Completion, (void*)marshalId);
g_LargeBufferCompletionInit = TRUE;
}
if(!g_LargeBufferTestCompletion.IsLinked())
{
g_LargeBufferTestCompletion.EnqueueDelta(1000);
}
int len = (size > ARRAYSIZE(s_Data)) ? ARRAYSIZE(s_Data) : size;
for(int i=0; i<len; i++)
{
s_Data[i] = pData[size - 1 - i];
}
s_LastSize = len;
}
示例13: rtp_thrd_timer_completion
/*----------------------------------------------------------------------*
rtp_thrd_timer_completion
*----------------------------------------------------------------------*/
void rtp_thrd_timer_completion(void* arg)
{
NATIVE_PROFILE_PAL_NETWORK();
/* Schedule the timer task to run as a continuation */
if(!TimerTaskContinuation.IsLinked())
{
TimerTaskContinuation.Enqueue();
}
/////////////////////////////////////////////////////////////////
// DO NT CHANGE!
// KEEP the timeout IN SYNC with _CFG_TIMER_FREQ
TimerTaskCompletion.EnqueueDelta(cfg_protocol_data.timer_freq * 1000);
// DO NT CHANGE!
/////////////////////////////////////////////////////////////////
}
示例14: rtp_thread_kill
/*----------------------------------------------------------------------*
rtp_thread_kill
*----------------------------------------------------------------------*/
int rtp_thread_kill (RTP_HANDLE * newThread,
RTP_ENTRY_POINT_FN entryPoint,
const char * name,
int stackSizeIndex,
int priorityIndex,
void * userData)
{
int * index = (int *) userData;
if ((rtp_strcmp(name, "ip interpret") == 0) && IPTaskInitialized[*index])
{
IPTaskInitialized[*index] = 0;
IPTaskContinuation[*index].Abort();
}
else if ((rtp_strcmp(name, "timer comp") == 0) && TimerTaskCompInitialized)
{
TimerTaskCompInitialized = 0;
TimerTaskCompletion.Abort();
}
else if ((rtp_strcmp(name, "timer cont") == 0) && TimerTaskContInitialized)
{
TimerTaskContInitialized = 0;
TimerTaskContinuation.Abort();
}
else if ((rtp_strcmp(name, "interrupt task") == 0) && InterruptTaskContInitialized[*index])
{
InterruptTaskContInitialized[*index] = 0;
InterruptTaskContinuation[*index].Abort();
}
else if ((rtp_strcmp(name, "dhcp") == 0) && DHCPTaskInitialized)
{
DHCPTaskInitialized = 0;
DHCPTaskContinuation.Abort();
}
return (0);
}
示例15: loop_lwip_open
/* ********************************************************************
open the loop back driver interface.
This routine opens a loop back device driver
The address of this function must be placed into the "devices" table in
iface.c either at compile time or before a device open is called.
******************************************************************** */
bool loop_lwip_open( struct netif *pNetIF )
{
NATIVE_PROFILE_HAL_DRIVERS_ETHERNET();
/* Now put in a dummy ethernet address get the ethernet address */
memcpy( pNetIF->hwaddr, phony_addr, ETHARP_HWADDR_LEN );
#if defined(FAKE_ASYNC_LOOPBACK_PROCESSING)
memset(&g_dummy_pbuf_chain,0,PBUF_CHAIN_DEPTH*sizeof(pbuf*));
g_fake_loopback_ISR.InitializeForISR( loop_lwip_send_packet, pNetIF );
#endif
/* JJM Possibly initialize Continuation here. loop_lwip_interrupt_continuation */
return( TRUE );
}