{
if(sum_deltay && coffy!= 0 && data != 0 && sum_deltay != 0)
{
- g_sum_y = 360/(float)sum_deltay * 1000 * coffy;
+ printf("sum_deltay : %d coffy : %.3f\n",sum_deltay,coffy);
+ // g_sum_y = 360/(float)sum_deltay * 1200 * coffy;
+ g_sum_y = (float)sum_deltay/1200.0f * 360.0f* coffy;
// printf("sum_deltay : %d\n",sum_deltay);
// printf("g_sum_y : %.3f,coffy : %.3f\n",g_sum_y,coffy);
*data = -g_sum_y;
}
else
{
- timer_cnt++;
- if (timer_cnt >= 200) // 20*10 = // 200ms:200ms内sensor没有检测到表冠转动就会关闭定时器重新开启中断响应
+ if(!factory_flag)
{
- // printf("hx3508 enter int mode\n");
- ots_timer_stop(); // 关闭定时器
- uapi_pin_set_ie(INT_PIN,HAL_PIO_IE_ENBALE);
- timer_cnt = 0;
+ timer_cnt++;
+ if (timer_cnt >= 200) // 20*10 = // 200ms:200ms内sensor没有检测到表冠转动就会关闭定时器重新开启中断响应
+ {
+ // printf("hx3508 enter int mode\n");
+ ots_timer_stop(); // 关闭定时器
+ uapi_pin_set_ie(INT_PIN,HAL_PIO_IE_ENBALE);
+ timer_cnt = 0;
+ }
}
+
if (stand_still == 0)
{
//上次是转动,上报状态改变