I have a application where I need to read the frequency on both pins. How can I switch at runtime the selected Input?
The Input is configured:
Reading lastCaptureGet() works fine
I tried
gpt_input_capture_extend_t * pFan12Extend;
pFan12Extend = g_inputFan12.p_cfg->p_extend;
if(pFan12Extend->signal == GPT_INPUT_CAPTURE_SIGNAL_PIN_GTIOCA) {
// switch to other pin
result += g_inputFan12.p_api->close(g_inputFan12.p_ctrl);
//g_input_capture_on_gpt->close();
pFan12Extend->signal = GPT_INPUT_CAPTURE_SIGNAL_PIN_GTIOCB;
result += g_inputFan12.p_api->open(g_inputFan12.p_ctrl, g_inputFan12.p_cfg);
} else {
// read speed
result = g_inputFan12.p_api->lastCaptureGet(g_inputFan12.p_ctrl, &speedFan2);
pFan12Extend->signal = GPT_INPUT_CAPTURE_SIGNAL_PIN_GTIOCA;
}
But that is not working...