[SOLVED] Changing PWM from an interrupt.
Posted: Tue Oct 13, 2015 5:23 pm
Hi,
I have an interrupt where I suddenly "know" the new value for a PWM module.
I tried:but that ends up in an assert that there is a syslock problem.
I now use:
Saves a few subroutine calls as well I guess.
Is there anything I can do to cleanup the code? Do I need to twist myself to pass the new value to the main program and then call pwmEnableChannel?
Solved:
I have an interrupt where I suddenly "know" the new value for a PWM module.
I tried:
Code: Select all
pwmEnableChannel(&PWMD3, chan, data);
I now use:
Code: Select all
PWMD3.tim->CCR[chan] = data;Is there anything I can do to cleanup the code? Do I need to twist myself to pass the new value to the main program and then call pwmEnableChannel?
Solved:
Code: Select all
pwmEnableChannelI (&PWMD3, baddr&3, d);