Software PWM - continued. Reduced stack usage.

Signed-off-by: denis-m-tyurin <denis.m.turin@gmail.com>