I'm using the Arduino ESP32 framework with VSCode (currently arduino-upstream for compatibility issues). It seems that it doesn't support PWM with dithering, so I implemented a modified version of the older ledcWrite() function code with dithering support. With prior implementations, it required locking a mutex via LEDC_MUTEX_LOCK() etc.
But newer versions use a different mutex, now held in IDF's components/driver/ledc.c:
I'm using the Arduino ESP32 framework with VSCode (currently arduino-upstream for compatibility issues). It seems that it doesn't support PWM with dithering, so I implemented a modified version of the older ledcWrite() function code with dithering support. With prior implementations, it required locking a mutex via LEDC_MUTEX_LOCK() etc.
But newer versions use a different mutex, now held in IDF's components/driver/ledc.c:
static portMUX_TYPE ledc_spinlock = portMUX_INITIALIZER_UNLOCKED;
can you remove 'static' so that external code can still lock this mutex?
of course ideally PWM dithering support would be exposed.