Update LEDC, PCNT,Timer_Group driver for esp32s2beta.
This commit is contained in:
@@ -96,7 +96,7 @@ 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.speed_mode = LEDC_LOW_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
|
||||
@@ -104,7 +104,7 @@ static void ledc_init(void)
|
||||
|
||||
// Prepare and then apply the LEDC PWM channel configuration
|
||||
ledc_channel_config_t ledc_channel;
|
||||
ledc_channel.speed_mode = LEDC_HIGH_SPEED_MODE;
|
||||
ledc_channel.speed_mode = LEDC_LOW_SPEED_MODE;
|
||||
ledc_channel.channel = LEDC_CHANNEL_1;
|
||||
ledc_channel.timer_sel = LEDC_TIMER_1;
|
||||
ledc_channel.intr_type = LEDC_INTR_DISABLE;
|
||||
@@ -187,19 +187,19 @@ void app_main()
|
||||
if (res == pdTRUE) {
|
||||
pcnt_get_counter_value(PCNT_TEST_UNIT, &count);
|
||||
printf("Event PCNT unit[%d]; cnt: %d\n", evt.unit, count);
|
||||
if (evt.status & PCNT_STATUS_THRES1_M) {
|
||||
if (evt.status & PCNT_EVT_THRES_1) {
|
||||
printf("THRES1 EVT\n");
|
||||
}
|
||||
if (evt.status & PCNT_STATUS_THRES0_M) {
|
||||
if (evt.status & PCNT_EVT_THRES_0) {
|
||||
printf("THRES0 EVT\n");
|
||||
}
|
||||
if (evt.status & PCNT_STATUS_L_LIM_M) {
|
||||
if (evt.status & PCNT_EVT_L_LIM) {
|
||||
printf("L_LIM EVT\n");
|
||||
}
|
||||
if (evt.status & PCNT_STATUS_H_LIM_M) {
|
||||
if (evt.status & PCNT_EVT_H_LIM) {
|
||||
printf("H_LIM EVT\n");
|
||||
}
|
||||
if (evt.status & PCNT_STATUS_ZERO_M) {
|
||||
if (evt.status & PCNT_EVT_ZERO) {
|
||||
printf("ZERO EVT\n");
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user