if(gHall_State != gHall_PrevState)
{
gHall_timer_now = HAL_readTimerCnt(halHandle,2); 定时器2
{
gHall_timer_now = HAL_readTimerCnt(halHandle,2); 定时器2
gHall_time_delta_now = gHall_timer_prev – gHall_timer_now;
gHall_timer_prev = gHall_timer_now;
gHall_timer_prev = gHall_timer_now;
gHall_time_delta = (gHall_time_delta_now + gHall_time_delta_prev)>>1;
gHall_time_delta_prev = gHall_time_delta_now;
gHall_time_delta_prev = gHall_time_delta_now;
gHall_speed_fdb_0p01Hz = gHall_speed_scale/gHall_time_delta;
gHall_speed_fdb_pu = gHall_speed_fdb_0p01Hz*gHall_Speed_0p01hzto_pu_sf;
gHall_speed_fdb_pu = gHall_speed_fdb_0p01Hz*gHall_Speed_0p01hzto_pu_sf;
proj-lab11e 历程中
用上个hall的 定时器2 的只 减去 本次hall 定时器2的值, 如果 上次的值小于本次的值, 那么 计算不是错了吗?