Skip to content

Commit d51d535

Browse files
authored
Merge pull request #479 from FrameworkComputer/hx30.fix_als_rounding
driver cm32183 fix int rounding error
2 parents 85fdf34 + 1b3cd80 commit d51d535

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

driver/als_cm32183.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ int cm32183_read_lux(int *lux, int af)
2727

2828
/*
2929
* lux = data * 0.016
30+
* lux = (data * 16 / 1000) * af / 10;
3031
*/
31-
*lux = (data * 16 / 1000) * af / 10;
32+
*lux = data * af * 16 / 10000;
3233

3334
return EC_SUCCESS;
3435
}

0 commit comments

Comments
 (0)