https://github.com/espressif/esp-idf/bl ... ple_main.c
the following lines are erroneous:
Code: Select all
if (evt.status & PCNT_EVT_THRES_1) {
printf("THRES1 EVT\n");
}
if (evt.status & PCNT_EVT_THRES_0) {
printf("THRES0 EVT\n");
}
if (evt.status & PCNT_EVT_L_LIM) {
printf("L_LIM EVT\n");
}
if (evt.status & PCNT_EVT_H_LIM) {
printf("H_LIM EVT\n");
}
if (evt.status & PCNT_EVT_ZERO) {
printf("ZERO EVT\n");
}
Code: Select all
typedef enum {
PCNT_EVT_L_LIM = 0, /*!< PCNT watch point event: Minimum counter value */
PCNT_EVT_H_LIM = 1, /*!< PCNT watch point event: Maximum counter value */
PCNT_EVT_THRES_0 = 2, /*!< PCNT watch point event: threshold0 value event */
PCNT_EVT_THRES_1 = 3, /*!< PCNT watch point event: threshold1 value event */
PCNT_EVT_ZERO = 4, /*!< PCNT watch point event: counter value zero event */
PCNT_EVT_MAX
} pcnt_evt_type_t;
Code: Select all
#define EvtMask_thres1_lat 0b00000100
#define EvtMask_thres0_lat 0b00001000
#define EvtMask_l_lim_lat 0b00010000
#define EvtMask_h_lim_lat 0b00100000
#define EvtMask_zero_lat 0b01000000
#define EvtMask_cnt_mode 0b00000011