errcode_t ret = uapi_pwm_close(channel);
// PRINT("uapi_pwm_close %d\n",ret);
- // LOS_Msleep((uint32_t)TEST_TCXO_DELAY_1000MS);
- LOS_Msleep(delay_ms);
+ // LOS_Mdelay((uint32_t)TEST_TCXO_DELAY_1000MS);
+ LOS_Mdelay(delay_ms);
uapi_pwm_deinit();
- LOS_Msleep(delay_ms);
+ LOS_Mdelay(delay_ms);
uapi_pin_set_mode(VIBRATOR_GPIOPPIN, (pin_mode_t)HAL_PIO_FUNC_GPIO);
uapi_gpio_set_dir(VIBRATOR_GPIOPPIN,GPIO_DIRECTION_OUTPUT);
uapi_gpio_set_val(VIBRATOR_GPIOPPIN,GPIO_LEVEL_LOW);
void g_VibratorFunc(uint16_t duty , uint16_t cycle_time_ms,uint16_t duration_time_ms)
{
-
+ errcode_t ret;
if( duty>100 || duty ==0 ||cycle_time_ms == 0 || duration_time_ms == 0)
{
PRINT("Not Supported param duty %u cycle_time_ms %u duration_time_ms %u !\r\n",duty,cycle_time_ms,duration_time_ms );
pwm_start(duty,cycle_time_ms);
- // LOS_Msleep(duration_time_ms);
+ // LOS_Mdelay(duration_time_ms);
LOS_Mdelay(duration_time_ms);
+ ret = pwm_stop();
+
+ if(ret != 0)
+ {
+ pwm_stop();
+ }
pwm_stop();
-
vibrating = 0;
}
}
while(duration_time_ms)
{
uapi_gpio_set_val(VIBRATOR_GPIOPPIN,GPIO_LEVEL_HIGH);
- LOS_Msleep(delaytime_ms_high);
+ LOS_Mdelay(delaytime_ms_high);
uapi_gpio_set_val(VIBRATOR_GPIOPPIN,GPIO_LEVEL_LOW);
- LOS_Msleep(delaytime_ms_low);
+ LOS_Mdelay(delaytime_ms_low);
duration_time_ms-=delaytime_ms_high;
duration_time_ms-=delaytime_ms_low;