Reworked manner in which PWM modes are calculated, and updated pwm_op_inv.S to use Mode definitions