Disable PWM properly after unexpected program exit.

Use constant value rather than literal for PWM duty cycle pulse-width computation.
Removed unused PWM frequency array.
Simplified conditional logic and comments setting up PWM.