本文整理汇总了C++中scheduler_init函数的典型用法代码示例。如果您正苦于以下问题:C++ scheduler_init函数的具体用法?C++ scheduler_init怎么用?C++ scheduler_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scheduler_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
/**@brief Function for bootloader main entry.
*/
int main(void)
{
uint32_t err_code;
bool dfu_start = false;
bool app_reset = (NRF_POWER->GPREGRET == BOOTLOADER_DFU_START);
// This check ensures that the defined fields in the bootloader corresponds with actual
// setting in the nRF51 chip.
APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START);
APP_ERROR_CHECK_BOOL(NRF_FICR->CODEPAGESIZE == CODE_PAGE_SIZE);
// Initialize.
timers_init();
gpiote_init();
buttons_init();
bootloader_init();
// Check if we reset in the middle of a firmware update
if (bootloader_dfu_sd_in_progress()) {
err_code = bootloader_dfu_sd_update_continue();
APP_ERROR_CHECK(err_code);
softdevice_init(!app_reset);
scheduler_init();
err_code = bootloader_dfu_sd_update_finalize();
APP_ERROR_CHECK(err_code);
} else {
// If stack is present then continue initialization of bootloader.
softdevice_init(!app_reset);
scheduler_init();
}
// Check if the Bootloader Control pin is low. If so, enter the bootloader
// mode.
dfu_start = (nrf_gpio_pin_read(BOOTLOADER_CTRL_PIN) == 0);
// If the Bootloader Control pin is low or the application in the flash
// is not valid, enter the bootloader mode.
if (dfu_start || (!bootloader_app_is_valid(DFU_BANK_0_REGION_START))) {
err_code = sd_power_gpregret_clr(POWER_GPREGRET_GPREGRET_Msk);
APP_ERROR_CHECK(err_code);
// Initiate an update of the firmware.
err_code = bootloader_dfu_start();
APP_ERROR_CHECK(err_code);
}
// If the application was or now is valid, run it
if (bootloader_app_is_valid(DFU_BANK_0_REGION_START)) {
// Select a bank region to use as application region.
// @note: Only applications running from DFU_BANK_0_REGION_START is supported.
bootloader_app_start(DFU_BANK_0_REGION_START);
}
NVIC_SystemReset();
}
示例2: main
int main (void) {
// Initialize the system
Initialize();
scheduler_init("led_task",0);
scheduler_init("motor_task",1);
set_timer();
enableIRQ();
Execute_Led_Task();
while(1);
}
示例3: pony_init
int pony_init(int argc, char** argv)
{
options_t opt;
memset(&opt, 0, sizeof(options_t));
// Defaults.
opt.mpmcq = true;
opt.cd_min_deferred = 4;
opt.cd_max_deferred = 18;
opt.cd_conf_group = 6;
opt.gc_initial = 1 << 14;
opt.gc_factor = 2.0f;
argc = parse_opts(argc, argv, &opt);
#if defined(PLATFORM_IS_LINUX)
pony_numa_init();
#endif
heap_setinitialgc(opt.gc_initial);
heap_setnextgcfactor(opt.gc_factor);
pony_exitcode(0);
scheduler_init(opt.threads, opt.noyield, opt.forcecd, opt.mpmcq);
cycle_create(opt.cd_min_deferred, opt.cd_max_deferred, opt.cd_conf_group);
return argc;
}
示例4: mote_main
int mote_main(void) {
board_init();
scheduler_init();
openwsn_init();
scheduler_start();
return 0; // this line should never be reached
}
示例5: main
int main(void)
{
/* LEDS */
DDRB=0xFF;
/* uart*/
uart_init();
// kbd_init();
scheduler_init();
/* ajoute la scrutation du clavier */
// scheduler_add_periodical_event(kbd_get_pressed, 100);
/* envoie les caracteres du clavier vers l'uart */
// kbd_register_event(menu_control);
/* creation du device */
fdevopen( (int (*)(char)) uart0_send,
(int (*)(void))uart0_recv,
0);
// se place sur le 1er fils
menu_goto(menu_down(menu_current()));
menu_print();
sei();
while(1);
return 0;
}
示例6: main
int main()
{
signal_stack = malloc (StackSize);
if (signal_stack == NULL)
{
printf("Cant malloc\n");
exit(1);
}
int i;
for (i=1; i<NumberOfContexts; i++)
{
MyTreads[i].ContextStatus = 0;//Free Tread
}
int l = (Interval*1000)%1000000;
AlarmInterval.it_interval.tv_sec = 0;
AlarmInterval.it_interval.tv_usec = l;
AlarmInterval.it_value.tv_sec = 0;
AlarmInterval.it_value.tv_usec = l;
if (setitimer(ITIMER_REAL, &AlarmInterval, 0)<0)
{
printf("Timer cant be set\n");
exit(1);
};
signal(SIGALRM, schedul_function);
scheduler_init(&SchedulerContext);
int Thread1 = thread_create(thread_1);
int Thread2 = thread_create(thread_2);
thread_wait(Thread1);
thread_wait(Thread2);
return 0;
}
示例7: platform_init
int platform_init(struct sof *sof)
{
int ret;
struct dai *esai;
clock_init();
scheduler_init();
platform_timer_start(platform_timer);
sa_init(sof);
clock_set_freq(CLK_CPU(cpu_get_id()), CLK_MAX_CPU_HZ);
/* init DMA */
ret = edma_init();
if (ret < 0)
return -ENODEV;
/* initialize the host IPC mechanims */
ipc_init(sof);
ret = dai_init();
if (ret < 0)
return -ENODEV;
esai = dai_get(SOF_DAI_IMX_ESAI, 0, DAI_CREAT);
if (!esai)
return -ENODEV;
dai_probe(esai);
return 0;
}
示例8: kern_start
void __init kern_start()
{
struct thread *main_thread;
mach_start();
kprintf("Starting Koowaldah v%s kernel.\n", VERSION_STRING);
/* memory allocation machinery: zones, buddy allocator, slices */
init_mem_info();
paging_init();
galloc_init();
kqueue_init();
timers_init();
sched0_load();
scheduler_init();
main_thread = thread_create(&kernel_main_thread, "GOD", NULL);
if (!main_thread) {
kprintf("Failed to create main kernel thread\n");
bug();
}
thread_switch_to(main_thread);
bug();
}
示例9: mote_main
int mote_main(OpenMote* self) {
board_init(self);
scheduler_init(self);
openwsn_init(self);
scheduler_start(self);
return 0; // this line should never be reached
}
示例10: chSysInit
/**
* @brief ChibiOS/RT initialization.
* @details After executing this function the current instructions stream
* becomes the main thread.
* @pre Interrupts must be still disabled when @p chSysInit() is invoked
* and are internally enabled.
* @post The main thread is created with priority @p NORMALPRIO.
* @note This function has special, architecture-dependent, requirements,
* see the notes into the various port reference manuals.
*
* @special
*/
void chSysInit(void) {
static Thread mainthread;
port_init();
scheduler_init();
vt_init();
#if CH_USE_MEMCORE
core_init();
#endif
#if CH_USE_HEAP
heap_init();
#endif
#if CH_DBG_ENABLE_TRACE
trace_init();
#endif
/* Now this instructions flow becomes the main thread.*/
setcurrp(_thread_init(&mainthread, NORMALPRIO));
currp->p_state = THD_STATE_CURRENT;
chSysEnable();
#if !CH_NO_IDLE_THREAD
/* This thread has the lowest priority in the system, its role is just to
serve interrupts in its context while keeping the lowest energy saving
mode compatible with the system status.*/
chThdCreateStatic(_idle_thread_wa, sizeof(_idle_thread_wa), IDLEPRIO,
(tfunc_t)_idle_thread, NULL);
#endif
}
示例11: main
/**@brief Function for application main entry.
*/
int main(void)
{
uint32_t err_code;
// Initialize
timers_init();
ble_stack_init();
bsp_module_init();
scheduler_init();
gap_params_init();
advertising_init();
services_init();
conn_params_init();
sec_params_init();
// Start execution
timers_start();
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
// Enter main loop
for (;;)
{
app_sched_execute();
power_manage();
}
}
示例12: main
/**@brief Function for application main entry.
*/
int main(void)
{
uint32_t err_code;
// Initialize
timers_init();
ble_stack_init();
bsp_module_init();
scheduler_init();
gap_params_init();
advertising_init();
services_init();
conn_params_init();
sec_params_init();
adc_init();
// Start execution
timers_start();
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
// Enter main loop
for (;;)
{
if(start_adc_sampling == true)
{
nrf_drv_saadc_sample_convert(0, &adc_value);
ble_android_characteristic_update(&m_android, &adc_value);
start_adc_sampling = false;
}
app_sched_execute();
// power_manage();
}
}
示例13: main
void main(void) {
//configuring
P1OUT |= 0x04; // set P1.2 for debug
P4DIR |= 0x20; // P4.5 as output (for debug)
gina_init();
scheduler_init();
leds_init();
if (*(&eui64+3)==0x09) { // this is a GINA board (not a basestation)
gyro_init();
large_range_accel_init();
magnetometer_init();
sensitive_accel_temperature_init();
}
radio_init();
timer_init();
P1OUT &= ~0x04; // clear P1.2 for debug
//check sensor configuration is right
gyro_get_config();
large_range_accel_get_config();
magnetometer_get_config();
sensitive_accel_temperature_get_config();
//scheduler_push_task(ID_TASK_APPLICATION);
scheduler_register_application_task(&task_application_imu_radio, 0, FALSE);
scheduler_start();
}
示例14: main
/**
* @brief Function for application main entry.
*/
int main(void)
{
uint32_t err_code;
//Initialize.
app_trace_init();
leds_init();
scheduler_init();
timers_init();
iot_timer_init();
button_init();
ble_stack_init();
advertising_init();
ip_stack_init ();
//Start execution.
advertising_start();
//Enter main loop.
for (;;)
{
//Execute event schedule.
app_sched_execute();
//Sleep waiting for an application event.
err_code = sd_app_evt_wait();
APP_ERROR_CHECK(err_code);
}
}
示例15: main
/**@brief Function for application main entry.
*/
int main(void)
{
// Initialize
timers_init();
gpiote_init();
ble_stack_init();
bsp_module_init();
scheduler_init();
gap_params_init();
advertising_init();
services_init();
conn_params_init();
sec_params_init();
// Start execution
timers_start();
advertising_start();
// Enter main loop
for (;;)
{
app_sched_execute();
power_manage();
}
}