My Version of MPGuino Code uses this small code. Only change to MPGuino original should be the use of standard math functions:
Code:
unsigned long instantfuelperhour(){
unsigned long instInjDur = instInjEnd - instInjStart;
if (instInjDur == 0) return 0;
return (instInjTot * 3600000000ull) * 1000ull / parms[MICRO_SECONDS_PER_LITER_IDX] / instInjDur;
}
Works just fine.