Fix: current_height_threshold_int_

This commit is contained in:
limengdu 2024-11-05 17:22:54 +08:00
parent 8d211eb257
commit b7d2626880

View File

@ -298,10 +298,10 @@ void MR60FDA2Component::process_frame_() {
} }
if (this->height_threshold_select_ != nullptr) { if (this->height_threshold_select_ != nullptr) {
uint32_t current_height_threshold_int_ = uint32_t current_height_threshold_int =
encode_uint32(current_data_buf_[7], current_data_buf_[6], current_data_buf_[5], current_data_buf_[4]); encode_uint32(current_data_buf_[7], current_data_buf_[6], current_data_buf_[5], current_data_buf_[4]);
height_threshold_float = bit_cast<float>(current_height_threshold_int_); height_threshold_float = bit_cast<float>(current_height_threshold_int);
size_t select_index = find_nearest_index(height_threshold_float, HEIGHT_THRESHOLD, 7); size_t select_index = find_nearest_index(height_threshold_float, HEIGHT_THRESHOLD, 7);
this->height_threshold_select_->publish_state(this->height_threshold_select_->at(select_index).value()); this->height_threshold_select_->publish_state(this->height_threshold_select_->at(select_index).value());
} }