updated to match pwmdriver.c