| 352 | |
| 353 | #if defined(HC32F4A0) || defined(HC32F460) || defined(HC32F448) || defined(HC32F4A8) |
| 354 | static void pm_run_main(void *parameter) |
| 355 | { |
| 356 | static rt_uint8_t run_index = 0; |
| 357 | char *speed[] = {"low", "high"}; |
| 358 | const rt_uint8_t run_mode[] = {PM_RUN_MODE_LOW_SPEED, PM_RUN_MODE_HIGH_SPEED}; |
| 359 | |
| 360 | GPIO_SetFunc(MCO_PORT, MCO_PIN, MCO_GPIO_FUNC); |
| 361 | /* Configure clock output system clock */ |
| 362 | CLK_MCOConfig(CLK_MCO1, CLK_MCO_SRC_HCLK, CLK_MCO_DIV8); |
| 363 | /* MCO1 output enable */ |
| 364 | CLK_MCOCmd(CLK_MCO1, ENABLE); |
| 365 | |
| 366 | while (1) |
| 367 | { |
| 368 | rt_pm_run_enter(run_mode[run_index]); |
| 369 | |
| 370 | rt_thread_mdelay(100); |
| 371 | |
| 372 | rt_kprintf("system clock switch to %s speed\n\n", speed[run_index]); |
| 373 | if (++run_index >= ARRAY_SZ(run_mode)) |
| 374 | { |
| 375 | run_index = 0; |
| 376 | } |
| 377 | |
| 378 | rt_thread_mdelay(3000); |
| 379 | } |
| 380 | } |
| 381 | #endif |
| 382 | |
| 383 | static void _keycnt_cmd_init_after_power_on(void) |
nothing calls this directly
no test coverage detected