mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
touch_element: fix unintended integer division
This commit is contained in:
parent
0e68d6fb29
commit
b615fd7f8f
@ -628,7 +628,7 @@ static uint32_t slider_filter_average(te_slider_handle_t slider_handle, uint32_t
|
||||
for (int win_idx = 0; win_idx < TE_SLD_DEFAULT_POS_FILTER_SIZE(s_te_sld_obj); win_idx++) { //Moving average filter
|
||||
position_average += slider_handle->pos_filter_window[win_idx];
|
||||
}
|
||||
position_average = position_average / TE_SLD_DEFAULT_POS_FILTER_SIZE(s_te_sld_obj) + 0.5;
|
||||
position_average = (uint32_t)((float)position_average / TE_SLD_DEFAULT_POS_FILTER_SIZE(s_te_sld_obj) + 0.5F);
|
||||
return position_average;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user