Y
Hacker News
new
|
ask
|
show
|
jobs
by
tos1
277 days ago
Cool! I'm wondering why is the lid-opening angle a 16 bit value without any scaling? Can MacBooks be opened > 255°? :)
(
https://github.com/ufoym/mac-angle/blob/main/angle.cpp#L186
)
3 comments
chippiewill
277 days ago
It's a low level library, it's probably just the register on the sensor itself is 16bit so that's what gets propagated up to the OS.
The most I can reach on mine is 132deg
link
GranPC
277 days ago
Technically yes - might have a bit of a hard time closing it back down tho.
link
mort96
277 days ago
The underlying system API is a u16. Do you propose that this library should add logic to clamp the value between 0 and 255? What would be the point in that?
link
bboygravity
277 days ago
To save 1 byte in RAM for the 300MB electron app that will load this lib.
link
The most I can reach on mine is 132deg