File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -83,13 +83,19 @@ - (NSString *)description {
83
83
// Returns value in [0.0, 1.0]
84
84
- (double )levelFromRawLeft : (uint64_t )left andRight : (uint64_t )right {
85
85
// FIXME(rdamazio): This value is probably incorrect
86
- // COMMENTS(dustinrue ) below is the observed max value on a 13" unibody MacBook (Late 2008)
86
+ // COMMENTS(jbeker ) below is the observed max value on a 15" Late 2013 Macbook Pro
87
87
// This value is ridiculous and results in a much smaller
88
88
// useful value range.
89
- const double kMaxLightValue = 67092480.0 ;
89
+ const double kClosedLightValue = 4294967295.0 ;
90
+ const double kMaxLightValue = 67092480.0 ;;
90
91
91
92
const double avg = (left + right) / 2 ; // determine average value from the two sensors
92
- return (avg / kMaxLightValue ); // normalize
93
+
94
+ if (avg == kClosedLightValue ) {
95
+ return 0 ; // COMMENTS(jbeker) on a 15" Late 2013 Macbook Pro it returns max value when the laptop is shut
96
+ } else {
97
+ return (avg / kMaxLightValue ); // normalize
98
+ }
93
99
}
94
100
95
101
- (void )doUpdate {
You can’t perform that action at this time.
0 commit comments