espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.61k stars 7.27k forks source link

make 'ledc_spinlock' in driver/ledc.c global (IDFGH-7195) #8794

Open gee-ell opened 2 years ago

gee-ell commented 2 years ago

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.

zalatnaicsongor commented 2 months ago

bumping this, hit the same issue