2010/8/19 Mike Frysinger <[email protected]>: > On Thursday, August 19, 2010 03:23:48 Frans Meulenbroeks wrote: >> improve the speed of gpio_set_valuea by using fputc instead of fprintf >> the overhead of fputc is less as no format string needs to be scanned >> and processed. Also used value + '0' so no conversion is needed > > i'd like an ack from Stefano, but this looks fine > > couldnt you also use fgetc() in get_value ? > > perhaps we should add to the top of both funcs that we assume the sysfs layer > is working only with '1' and '0'. that would keep things from doing > fprintf/fscanf. i think that's an OK assumption to make. > -mike > Technically using fgetc in get_value could be done. Then again I don't expect that one to be used often. If we want to optimize get_value, I think it is better to take the open and close calls out of the function (like currently is the case for the set function).
Frans ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ UrJTAG-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/urjtag-development
