#include #include #include #include #include #include #include "indicator_led.h" #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(E, 12) #define LED_ON PIN_HIGH #define LED_OFF PIN_LOW void fan_on(void) { LOG3("fan on!"); motor_speed(100); } void fan_off(void) { LOG3("fan off!"); motor_speed(0); } void light_on(void) { LOG3("light on!"); rt_pin_mode(PIN_LED_B, PIN_MODE_OUTPUT); rt_pin_write(PIN_LED_B, LED_ON); } void light_off(void) { LOG3("light off!"); rt_pin_mode(PIN_LED_B, PIN_MODE_OUTPUT); rt_pin_write(PIN_LED_B, LED_OFF); } void danger_status(void) { char *str = "aa"; serial_send(str); sim_call("17318112360"); fan_on(); light_on(); LED_BreathMore(0,LED_NUM-1,LED_RED); } MSH_CMD_EXPORT_ALIAS(danger_status, danger, show danger_status); void normal_status(void) { fan_off(); light_off(); LED_SetMore(0,LED_NUM-1,LEDI_OFF); }