#include #include #include #include #include #include #define THREAD_PRIORITY 25 #define THREAD_STACK_SIZE 4096 #define THREAD_TIMESLICE 5 #define LOG_TAG "status" #define DBG_LVL DBG_LOG // #define DBG_LVL DBG_INFO #define USE_LOG1 #define USE_LOG2 #define USE_LOG3 // #define USE_LOG4 #define USE_LOG5 // #define USE_LOG6 // #define USE_LOG_D #include "logn.h" /* 配置 LED 灯引脚 */ #define PIN_LED_B GET_PIN(F, 11) // PF11 : LED_B --> LED #define PIN_LED_R GET_PIN(F, 12) // PF12 : LED_R --> LED void danger_status(void) { char *str = "aa"; serial_send(str); sim_call("17318112360"); } MSH_CMD_EXPORT_ALIAS(danger_status, danger, show danger_status); void fan_on(void) { LOG3("fan on!"); motor_speed(100); } void fan_off(void) { LOG3("fan off!"); motor_speed(20); } void light_on(void) { LOG3("light on!"); rt_pin_mode(PIN_LED_B, PIN_MODE_OUTPUT); rt_pin_write(PIN_LED_B, PIN_LOW); } void light_off(void) { LOG3("light off!"); rt_pin_mode(PIN_LED_B, PIN_MODE_OUTPUT); rt_pin_write(PIN_LED_B, PIN_LOW); }