I tried to implement an EXT callback function and would like to print some messages thru usb serial driver in it.
I just found that whenever I go into the ISR callback function, the kernel was stuck. In this case, is there any other way to print?
Code: Select all
static void extcb1(EXTDriver *extp, expchannel_t channel) {
chprintf((BaseSequentialStream *)&SDU1, "hello\r\n");
static VirtualTimer vt4;
(void)extp;
(void)channel;
palSetPad(GPIOB, GPIOB_LED4);
chSysLockFromIsr();
if (chVTIsArmedI(&vt4))
chVTResetI(&vt4);
/* LED4 set to OFF after 200mS.*/
chVTSetI(&vt4, MS2ST(200), led4off, NULL);
chSysUnlockFromIsr();
}
Thanks!
Shan.