mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-20 17:26:30 +00:00
Merge pull request #12910 from s-hadinger/esp32c3_pwm
Fixed PWM5 on ESP32C3
This commit is contained in:
commit
d5b4ce1233
@ -10,6 +10,9 @@ All notable changes to this project will be documented in this file.
|
||||
### Changed
|
||||
- Berry now compiling in ``strict`` mode to catch more bugs
|
||||
|
||||
### Fixed
|
||||
- Fixed PWM5 on ESP32C3
|
||||
|
||||
## [9.5.0.5] 20210815
|
||||
### Added
|
||||
- Inital support for Wi-Fi extender (#12784)
|
||||
|
@ -32,12 +32,21 @@
|
||||
* ESP32 analogWrite emulation support
|
||||
\*********************************************************************************************/
|
||||
|
||||
#define PWM_SUPPORTED_CHANNELS 8
|
||||
#define PWM_CHANNEL_OFFSET 2 // Webcam uses channel 0, so we offset standard PWM
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#define PWM_SUPPORTED_CHANNELS 6
|
||||
#define PWM_CHANNEL_OFFSET 1 // Webcam uses channel 0, so we offset standard PWM
|
||||
|
||||
uint8_t _pwm_channel[PWM_SUPPORTED_CHANNELS] = { 99, 99, 99, 99, 99, 99, 99, 99 };
|
||||
uint32_t _pwm_frequency = 977; // Default 977Hz
|
||||
uint8_t _pwm_bit_num = 10; // Default 1023
|
||||
uint8_t _pwm_channel[PWM_SUPPORTED_CHANNELS] = { 99, 99, 99, 99, 99, 99 };
|
||||
uint32_t _pwm_frequency = 977; // Default 977Hz
|
||||
uint8_t _pwm_bit_num = 10; // Default 1023
|
||||
#else // other ESP32
|
||||
#define PWM_SUPPORTED_CHANNELS 8
|
||||
#define PWM_CHANNEL_OFFSET 2 // Webcam uses channel 0, so we offset standard PWM
|
||||
|
||||
uint8_t _pwm_channel[PWM_SUPPORTED_CHANNELS] = { 99, 99, 99, 99, 99, 99, 99, 99 };
|
||||
uint32_t _pwm_frequency = 977; // Default 977Hz
|
||||
uint8_t _pwm_bit_num = 10; // Default 1023
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C3 vs ESP32
|
||||
|
||||
inline uint32_t _analog_pin2chan(uint32_t pin) {
|
||||
for (uint32_t channel = 0; channel < PWM_SUPPORTED_CHANNELS; channel++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user