如题,本程序使用stm32f103rctc(正*原子mini板),使用rtt操作系统,进入停机模式及唤醒
单片机源程序如下:
- /*
- * File : main.c
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2009, RT-Thread Development Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *
- * Change Logs:
- * Date Author Notes
- * 2015-07-29 Arda.Fu first implementation
- */
- #include <rtthread.h>
- #include <rtdevice.h>
- #include "wake_up.h"
- int main(void)
- {
- WKUP_Init();
- // rt_pin_mode(25,PIN_MODE_INPUT_PULLUP);
- // rt_pin_mode(50,PIN_MODE_INPUT_PULLUP);
-
- rt_pin_mode(27,PIN_MODE_INPUT_PULLUP);//key
-
- rt_pin_mode(55,PIN_MODE_OUTPUT);//beep
- rt_pin_write(55,1);
-
- rt_pin_mode(56,PIN_MODE_OUTPUT);//led
- rt_pin_write(56,0);
- /* user app entry */
- while(1)
- {
- if(rt_pin_read(25) == 0 ||rt_pin_read(50) == 0)
- {
- Sys_Enter_Standby();
- }
- rt_thread_delay(rt_tick_from_millisecond(1));
- }
- return 0;
- }
复制代码
所有资料51hei提供下载:
stm32f10x_Low_Power.rar
(1.18 MB, 下载次数: 36)
|