User avatar
By eriksl
#54522 At the top of the PWM code there is a #define where you select the mode of operation, "legacy"/"compatibility"/etc mode or "native"/etc mode. You need to make sure the #defines are such that "native" mode is used. I don't have the source here right now, maybe you can copy that part and I'll you what to #define or #undef.
User avatar
By eriksl
#54553
de1m wrote:do you mean that (from pwm.c)?
Code: Select all#ifndef SDK_PWM_PERIOD_COMPAT_MODE
  #define SDK_PWM_PERIOD_COMPAT_MODE 0
#endif

Yes, exactly that. Make sure it never gets #defined to 1.

Then, adapt the period (for pwm_init) to what you expect (see my previous comment), probably 65536 or 32768.