Added code for hardware pwm and extended test code.