|
@@ -793,11 +793,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;
|
|
|
|
|
- shake_i = atoi(device_status.power);
|
|
|
|
|
- LOG_I("震动电机待机电流:%d",shake_i);
|
|
|
|
|
- if(device_status.dtype==7&&shake_sec!=0)
|
|
|
|
|
- DTU_Write("drop");
|
|
|
|
|
rt_pin_mode(SHAKE_SW, PIN_MODE_OUTPUT);
|
|
rt_pin_mode(SHAKE_SW, PIN_MODE_OUTPUT);
|
|
|
#if 0
|
|
#if 0
|
|
|
rt_pin_write(SHAKE_SW,ON);
|
|
rt_pin_write(SHAKE_SW,ON);
|
|
@@ -805,44 +800,28 @@ 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--)
|
|
|
|
|
|
|
+ for(uint8_t shake_i = 0;shake_i<shake_sec;shake_i++)
|
|
|
{
|
|
{
|
|
|
|
|
+ rt_pin_write(SHAKE_SW,ON);
|
|
|
rt_thread_delay(100);
|
|
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,OFF);
|
|
|
|
|
+ rt_thread_delay(1000);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(device_status.dtype==7) rt_thread_delay(shake_sec*1000);
|
|
|
|
|
rt_pin_write(SHAKE_SW,OFF);
|
|
rt_pin_write(SHAKE_SW,OFF);
|
|
|
HMI_WRITE("cangWei.switchShake.val=%d",0);
|
|
HMI_WRITE("cangWei.switchShake.val=%d",0);
|
|
|
|
|
+ system_status.vibration_count += 1;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
rt_pin_write(SHAKE_SW,OFF);
|
|
rt_pin_write(SHAKE_SW,OFF);
|
|
|
HMI_WRITE("cangWei.switchShake.val=%d",0);
|
|
HMI_WRITE("cangWei.switchShake.val=%d",0);
|
|
|
}
|
|
}
|
|
|
- if(device_status.dtype==7)
|
|
|
|
|
- HMI_WRITE("sysTest.switchDrop.val=%d",OFF);
|
|
|
|
|
return status_shake;
|
|
return status_shake;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//补光
|
|
//补光
|
|
|
uint8_t ctr_led(uint8_t status_led)
|
|
uint8_t ctr_led(uint8_t status_led)
|
|
|
{
|
|
{
|