In calculate_leg_data_out_ref & pwm_op_inv: Made time_offset arithmetic (i.e. -ve for earlier)