Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)





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


Technically yes - might have a bit of a hard time closing it back down tho.

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?

To save 1 byte in RAM for the 300MB electron app that will load this lib.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: