Closed ktingey closed 7 years ago
Change the HDC1080 conversion to account for overflow around 42*C. The code below should work:
int16_t res = ((regval[0] << 8) | regval[1]) >> 2; return (int_t)(((uint32_t)20625 * res + (uint32_t)1024) >> 11) - (int32_t)40000;
int16_t res = ((regval[0] << 8) | regval[1]) >> 2;
return (int_t)(((uint32_t)20625 * res + (uint32_t)1024) >> 11) - (int32_t)40000;
resolved
Change the HDC1080 conversion to account for overflow around 42*C. The code below should work:
int16_t res = ((regval[0] << 8) | regval[1]) >> 2;
return (int_t)(((uint32_t)20625 * res + (uint32_t)1024) >> 11) - (int32_t)40000;