Skip to content

Instantly share code, notes, and snippets.

View maximevince's full-sized avatar

Maxime Vincent maximevince

View GitHub Profile
@maximevince
maximevince / fanshim.py
Created September 17, 2019 12:35
PiMoroni Fan Shim on LibreElec (including the LEDs)
#!/usr/bin/env python
#
# place command below in /storage/.config/autostart.sh
# nohup /storage/fanshim.py &
#
# By Maxime Vincent (maxime [dot] vince [at] gmail [dot] com)
#
# Based on:
# http://www.philrandal.co.uk/blog/archives/2019/07/entry_214.html
# https://forum-raspberrypi.de/forum/thread/43568-fan-shim-steuern/
@maximevince
maximevince / sqrt_int32.c
Created October 15, 2019 16:25
integer sqrt
/* Simple SQRT calculation
* NOTE: result fits within uint16_t (of course)
*/
uint32_t sqrt_int32(uint32_t x)
{
uint32_t res = 0;
uint32_t add = 0x8000;
uint32_t temp;
uint8_t i;