-
• #2
My guess in
period
andpulseLength
are uint64 values, not uint32? This is a classic C printf-style problem.You just need to cast the values to be 32 bit:
jsWarn("duty:%f,period:%d,pulse:%d \n",dutyCycle,(uint32_t)period,(uint32_t)pulseLength); jsWarn("duty:%f,pulse:%d,period:%d \n",dutyCycle,(uint32_t)pulseLength,(uint32_t)period);
During debugging for software PWM some jsWarn (in jstimer, function jstPinPWM) have been used.
Looks to me, that 2nd var of same type is always shown as zero.
See attached code, where only sequence of 2 vars is changed:
Result in debug window is:
WARNING: duty:0.5,period:100000,pulse:0
WARNING: duty:0.5,pulse:50000,period:0
Or is %d the wrong format ?