MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / pm_sample_init

Function pm_sample_init

bsp/hc32/tests/test_pm.c:448–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448int pm_sample_init(void)
449{
450 pm_dbg("pm_sample_init\n\n");
451
452 _keycnt_cmd_init_after_power_on();
453 _vbat_init();
454 _key_int_init();
455
456 rt_pm_notify_set(_notify_func, NULL);
457
458 rt_thread_t thread = rt_thread_create("pm_cmd_handler", pm_cmd_handler, RT_NULL, 1024, 25, 10);
459 if (thread != RT_NULL)
460 {
461 rt_thread_startup(thread);
462 }
463 else
464 {
465 rt_kprintf("create pm sample thread failed!\n");
466 }
467
468#if defined(HC32F4A0) || defined(HC32F460) || defined(HC32F448) || defined(HC32F4A8)
469 thread = rt_thread_create("pm_run_main", pm_run_main, RT_NULL, 1024, 25, 10);
470 if (thread != RT_NULL)
471 {
472 rt_thread_startup(thread);
473 }
474 else
475 {
476 rt_kprintf("create pm run thread failed!\n");
477 }
478#endif
479
480 return RT_EOK;
481}
482MSH_CMD_EXPORT(pm_sample_init, pm sample init);
483
484#endif /* end of BSP_USING_PM */

Callers

nothing calls this directly

Calls 7

_vbat_initFunction · 0.85
_key_int_initFunction · 0.85
rt_pm_notify_setFunction · 0.85
rt_thread_createFunction · 0.85
rt_thread_startupFunction · 0.85
rt_kprintfFunction · 0.85

Tested by

no test coverage detected