[PATCH 1/2] fix-gta02_lis302dl_bitbang.patch

Werner Almesberger werner at openmoko.org
Sat Nov 15 03:42:21 CET 2008


Nelson Castillo wrote:
> -			shifter = tx[n >> 3];
> +			shifter = ~tx[n >> 3];
>  		s3c2410_gpio_setpin(pdata->pin_clk, 0);
> -		s3c2410_gpio_setpin(pdata->pin_mosi, (shifter >> (7 - n)) & 1);
> +		s3c2410_gpio_setpin(pdata->pin_mosi, !(shifter & 0x80));

Hmm, wouldn't
		shifter = tx[n >> 3];
and
		... !!(shifter & 0x80) ...
be a bit more efficient (and perhaps a tad more obvious as well) ?

- Werner



More information about the openmoko-kernel mailing list