|
@@ -455,8 +455,6 @@ uint8_t ctr_lamp(uint8_t status_lamp,uint8_t lamp_num)
|
|
|
uint8_t ctr_shake(uint8_t status_shake,uint16_t shake_sec)
|
|
uint8_t ctr_shake(uint8_t status_shake,uint16_t shake_sec)
|
|
|
{
|
|
{
|
|
|
static rt_uint16_t shake_i = 0;
|
|
static rt_uint16_t shake_i = 0;
|
|
|
- shake_i = atoi(device_status.power);
|
|
|
|
|
- LOG_I("震动电机待机电流:%d",shake_i);
|
|
|
|
|
if(device_status.dtype==7&&shake_sec!=0)
|
|
if(device_status.dtype==7&&shake_sec!=0)
|
|
|
DTU_Write("drop");
|
|
DTU_Write("drop");
|
|
|
rt_pin_mode(SHAKE_SW, PIN_MODE_OUTPUT);
|
|
rt_pin_mode(SHAKE_SW, PIN_MODE_OUTPUT);
|
|
@@ -466,29 +464,14 @@ uint8_t ctr_shake(uint8_t status_shake,uint16_t shake_sec)
|
|
|
#endif
|
|
#endif
|
|
|
if(status_shake==ON&&device_status.shake_ws==1)
|
|
if(status_shake==ON&&device_status.shake_ws==1)
|
|
|
{
|
|
{
|
|
|
- #if 0
|
|
|
|
|
- for(int8_t s = 0;s++;s<2)
|
|
|
|
|
- {
|
|
|
|
|
- rt_pin_write(SHAKE_SW,ON);
|
|
|
|
|
- rt_thread_delay(100);
|
|
|
|
|
- rt_pin_write(SHAKE_SW,OFF);
|
|
|
|
|
- rt_thread_delay(1000);
|
|
|
|
|
- }
|
|
|
|
|
- #endif
|
|
|
|
|
-
|
|
|
|
|
- rt_pin_write(SHAKE_SW,ON);
|
|
|
|
|
if(device_status.dtype==3)
|
|
if(device_status.dtype==3)
|
|
|
{
|
|
{
|
|
|
while(shake_sec--)
|
|
while(shake_sec--)
|
|
|
{
|
|
{
|
|
|
- rt_thread_delay(100);
|
|
|
|
|
- if(shake_sec==20&&device_status.clear_status==0&&device_status.work_status==1&&atoi(device_status.power)-shake_i<100&&shake_i!=0&&shake_i<5000)
|
|
|
|
|
- {
|
|
|
|
|
- char * shake_warn = makeJson_Warn("电流不足", "震动电机");
|
|
|
|
|
- DTU_Write("%s",shake_warn);
|
|
|
|
|
- rt_free(shake_warn);
|
|
|
|
|
- }
|
|
|
|
|
- LOG_D("震动电机:%d",atoi(device_status.power));
|
|
|
|
|
|
|
+ rt_pin_write(SHAKE_SW,ON);
|
|
|
|
|
+ rt_thread_delay(50);
|
|
|
|
|
+ rt_pin_write(SHAKE_SW,OFF);
|
|
|
|
|
+ rt_thread_delay(1000);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(device_status.dtype==7) rt_thread_delay(shake_sec*1000);
|
|
if(device_status.dtype==7) rt_thread_delay(shake_sec*1000);
|
|
@@ -2174,7 +2157,7 @@ static void Control_Check_thread_entry(void *parameter)
|
|
|
}else {
|
|
}else {
|
|
|
process = 0;
|
|
process = 0;
|
|
|
current_second = 0;
|
|
current_second = 0;
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if MATCH_DEVICE == 1
|
|
|
if(device_status.rain_status==0)
|
|
if(device_status.rain_status==0)
|
|
|
{
|
|
{
|
|
|
rt_pin_mode(LED_P, PIN_MODE_OUTPUT);
|
|
rt_pin_mode(LED_P, PIN_MODE_OUTPUT);
|