本文整理汇总了C++中SingletonPtr::start方法的典型用法代码示例。如果您正苦于以下问题:C++ SingletonPtr::start方法的具体用法?C++ SingletonPtr::start怎么用?C++ SingletonPtr::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SingletonPtr
的用法示例。
在下文中一共展示了SingletonPtr::start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: platform_fhss_timer_start
static int platform_fhss_timer_start(uint32_t slots, void (*callback)(const fhss_api_t *api, uint16_t), const fhss_api_t *callback_param)
{
int ret_val = -1;
platform_enter_critical();
if (timer_initialized == false) {
#if !MBED_CONF_NANOSTACK_HAL_CRITICAL_SECTION_USABLE_FROM_INTERRUPT
equeue = mbed_highprio_event_queue();
MBED_ASSERT(equeue != NULL);
#endif
timer->start();
timer_initialized = true;
}
fhss_timeout_s *fhss_tim = find_timeout(callback);
if (!fhss_tim) {
fhss_tim = allocate_timeout();
}
if (!fhss_tim) {
platform_exit_critical();
tr_error("Failed to allocate timeout");
return ret_val;
}
fhss_tim->fhss_timer_callback = callback;
fhss_tim->start_time = read_current_time();
fhss_tim->stop_time = fhss_tim->start_time + slots;
fhss_tim->active = true;
fhss_tim->timeout->attach_us(timer_callback, slots);
fhss_active_handle = callback_param;
ret_val = 0;
platform_exit_critical();
return ret_val;
}
示例2: platform_timer_enable
// Called once at boot
void platform_timer_enable(void)
{
#if !MBED_CONF_NANOSTACK_HAL_CRITICAL_SECTION_USABLE_FROM_INTERRUPT
equeue = mbed_highprio_event_queue();
MBED_ASSERT(equeue != NULL);
#endif
timer->start();
// Prime the SingletonPtr - can't construct from IRQ/critical section
timeout.get();
}
示例3: _rtc_lpticker_init
static void _rtc_lpticker_init(void)
{
_rtc_lp_timer->start();
_rtc_enabled = true;
}