The next code of the first post:setup_capture(1, CAPTURE_RE | INTERRUPT_EVERY_CAPTURE | CAPTURE_SYSTEM_CLOCK | CAPTURE_TRIG_SYNC_IC2 | COMPARE_32_BIT); // ...
COMPARE_TRIG_SYNC_SELF has the value 0x001F0000. This corresponds to the bits <4:0> and seems to be an option for the register OCxCON2. OCxCON2 is a part of the output compare.
I haven't used timer2. Added the timer configuration in the first post. Timer 1 is used for something else. What I understand from the documentation is that the capture unit have their own timer. See ...