Target: STM32F407
Ver: Trunk
I'm getting the debug assertion error below when I try to use gptStartOneShotI() from within my EXT callback:
chDbgAssert(gptp->state == GPT_READY,"gptStartContinuousI(), #1", "invalid state") // gpt.c
main() {
gptStart(&GPTD2, &gpt2cfg);
gptPolledDelay(&GPTD2, 1000);
extStart(&EXTD1, &extcfg);
}
extcb1 {
chSysLockFromIsr();
gptStartOneShotI(&GPTD2, 200);
chSysUnlockFromIsr();
}
Am I doing something wrong, or is this a bug? Thanks....!
Problem calling gptStartOneShotI from EXT callback
Moderators: RoccoMarco, lbednarz, tfAteba
Problem calling gptStartOneShotI from EXT callback
- Attachments
-
- USB_CDC_03.zip
- (110.58 KiB) Downloaded 308 times
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Problem calling gptStartOneShotI from EXT callback
Hi,
It is possible you get two EXT callbacks in short time and the second one fails because the GPT is already active. Could you confirm if this is the case?
If so you could check the GPT ste before invoking gptStartOneShot() to check if has already been triggered.
Giovanni
It is possible you get two EXT callbacks in short time and the second one fails because the GPT is already active. Could you confirm if this is the case?
If so you could check the GPT ste before invoking gptStartOneShot() to check if has already been triggered.
Giovanni
Re: Problem calling gptStartOneShotI from EXT callback
Yup, that was it! I shouldn't have assumed that the monostable implementation was retriggerable
Thanks!
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Problem calling gptStartOneShotI from EXT callback
Actually, adding a retriggerable variant or just make it retriggerable is not a bad idea.
Giovanni
Giovanni