/* Take a 32 bit variable in parameters and returns a value between 0 and 255.  */
static uint8_t clip32_to_8(int32_t i)
/* Take a 32 bit variable in parameters and returns a value between 0 and 255.  */
static uint8_t clip32_to_8(int32_t i)
{
	if (i > 255) {
		return 255;
	}
	if (i < 0) {
		return 0;
	}
	return (uint8_t)i;
}