/* creates the ADC command for the MAX1271 range is the range value from comedi  */
static int8_t create_adc_command(unsigned int chan, int range)
/* creates the ADC command for the MAX1271 range is the range value from comedi  */
static int8_t create_adc_command(unsigned int chan, int range)
{
	int8_t p = (range <= 1);
	int8_t r = ((range % 2) == 0);
	return (chan << 4) | ((p == 1) << 2) | ((r == 1) << 3);
}