Provided more meaningful parameter names by renaming 'bit_num' to 'duty_resolution' and 'div_num' to 'clock_divider'
This commit is contained in:
@@ -60,10 +60,10 @@ void app_main()
|
||||
* that will be used by LED Controller
|
||||
*/
|
||||
ledc_timer_config_t ledc_timer = {
|
||||
.bit_num = LEDC_TIMER_13_BIT, // resolution of PWM duty
|
||||
.freq_hz = 5000, // frequency of PWM signal
|
||||
.speed_mode = LEDC_HS_MODE, // timer mode
|
||||
.timer_num = LEDC_HS_TIMER // timer index
|
||||
.duty_resolution = LEDC_TIMER_13_BIT, // resolution of PWM duty
|
||||
.freq_hz = 5000, // frequency of PWM signal
|
||||
.speed_mode = LEDC_HS_MODE, // timer mode
|
||||
.timer_num = LEDC_HS_TIMER // timer index
|
||||
};
|
||||
// Set configuration of timer0 for high speed channels
|
||||
ledc_timer_config(&ledc_timer);
|
||||
|
||||
@@ -96,10 +96,10 @@ static void ledc_init(void)
|
||||
{
|
||||
// Prepare and then apply the LEDC PWM timer configuration
|
||||
ledc_timer_config_t ledc_timer;
|
||||
ledc_timer.speed_mode = LEDC_HIGH_SPEED_MODE;
|
||||
ledc_timer.timer_num = LEDC_TIMER_1;
|
||||
ledc_timer.bit_num = LEDC_TIMER_10_BIT;
|
||||
ledc_timer.freq_hz = 1; // set output frequency at 1 Hz
|
||||
ledc_timer.speed_mode = LEDC_HIGH_SPEED_MODE;
|
||||
ledc_timer.timer_num = LEDC_TIMER_1;
|
||||
ledc_timer.duty_resolution = LEDC_TIMER_10_BIT;
|
||||
ledc_timer.freq_hz = 1; // set output frequency at 1 Hz
|
||||
ledc_timer_config(&ledc_timer);
|
||||
|
||||
// Prepare and then apply the LEDC PWM channel configuration
|
||||
|
||||
Reference in New Issue
Block a user