Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

driver/lc709203f: remove unnecessary use of float #19662

Merged
merged 1 commit into from
May 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion drivers/lc709203f/lc709203f.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ int16_t lc709203f_get_cell_temp(const lc709203f_t *dev)
DEBUG("CRC Error \n");
return 0;
}
return ((((unsigned int)rec_buf[1] << 8) | rec_buf[0]) - 2731.5);
/* sensor temperature is given in 0.1K -> -2731.5 would be the correct value
* returning in 0.1°C int16_t -> using rounded 2732 */
return ((((int16_t)rec_buf[1] << 8) | rec_buf[0]) - 2732);
}

lc709203f_temp_obtaining_mode_t lc709203f_get_status_bit(const lc709203f_t *dev)
Expand Down