GPT timer
Posted: Fri May 12, 2017 2:55 pm
Hello,
I try to measure the width of a pulse using a general purpose timer. The function is invoked as callback to the EXTD1 driver, triggers on EXTI2 event:
void _extIRQ(EXTDriver *extp, expchannel_t channel)
{
if (_edgeChange == 0) {
gptStartContinuous(&GPTD5, 0); //greatest possible reset value
_edgeChange = 1;
} else {
gptStopTimer(&GPTD5);
_klineCfg.speed = 1000000 / gptGetCounterX(&GPTD5);
}
}
I can't invoke neighter gptStartContinuous nor gptStartContinuousI -> assert of improper I class use. It looks working properly if I disable CH_DBG_ENABLE_CHECKS in chconf.h. Could you please advice what is the proper way to use gptStartContinuous ?
I try to measure the width of a pulse using a general purpose timer. The function is invoked as callback to the EXTD1 driver, triggers on EXTI2 event:
void _extIRQ(EXTDriver *extp, expchannel_t channel)
{
if (_edgeChange == 0) {
gptStartContinuous(&GPTD5, 0); //greatest possible reset value
_edgeChange = 1;
} else {
gptStopTimer(&GPTD5);
_klineCfg.speed = 1000000 / gptGetCounterX(&GPTD5);
}
}
I can't invoke neighter gptStartContinuous nor gptStartContinuousI -> assert of improper I class use. It looks working properly if I disable CH_DBG_ENABLE_CHECKS in chconf.h. Could you please advice what is the proper way to use gptStartContinuous ?