robertobucher / pysimCoder

Block diagram editor and real time code generator for Python
GNU General Public License v3.0
142 stars 31 forks source link

CodeGen/nuttx/devices/nuttx_PWM.c: zeroed struct pwm_info_s info and define PWM polarity #71

Closed zdebanos closed 5 months ago

zdebanos commented 5 months ago

Some attributes of the info could have been uninitialized.

Set all channels' polarity to active high (PWM_CPOL_HIGH).

michallenc commented 5 months ago

I see this was already merged. We can resolve the comments here and then do the fixup patch.

ppisa commented 5 months ago

The problem is that PWM_CPOL_HIGH was introduced into NuttX at August 2023, so if you have older NuttX export then the pysimCoder NuttX devices build would fail.

robertobucher commented 5 months ago

But recompiling is ok (tested on my F7 board)...

zdebanos commented 5 months ago

I'll look into it further and I'll try to implement some changes into NuttX that should set the default PWM's output values when turned off.

zdebanos commented 5 months ago

@robertobucher The default polarity in the "turned off" state of the PWM has made it into the NuttX mainline. I'll update soon.