detecting two rising edges from camshaft signal