Update drv_pwm.c

Reformated the code, tested it again - works. The failsafeCheck is not changed and probably needs further attention from the BF folks.