Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Commit

Permalink
Cap humidity to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
ojousima committed Oct 29, 2019
1 parent d007f5d commit 02a4332
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/bme280/bme280.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ static uint32_t compensate_H_int32(int32_t adc_H)

v_x1_u32r = (v_x1_u32r - (((((v_x1_u32r >> 15) * (v_x1_u32r >> 15)) >> 7) * ((int32_t)bme280.cp.dig_H1)) >> 4));
v_x1_u32r = (v_x1_u32r < 0 ? 0 : v_x1_u32r);
// Cap maximum reported value to 120%
v_x1_u32r = (v_x1_u32r > 503316480 ? 503316480 : v_x1_u32r);
// Cap maximum reported value to 100%
v_x1_u32r = (v_x1_u32r > (100<<22) ? (100<<22) : v_x1_u32r);

return (uint32_t)(v_x1_u32r >> 12);
}
Expand Down

2 comments on commit 02a4332

@DG12
Copy link
Contributor

@DG12 DG12 commented on 02a4332 Oct 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide some information regarding the discussion with Bosch?

Nicer constant by the way.

I think you should add a comment to issue# #157

@ojousima
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's not a lot more information to provide, they simply recommend to keep the cap as-is.

Please sign in to comment.