Today I come here because I used event for SERIAL Driver input a long time and now with the new functions I was testing its functionality as seen in this post: http://forum.chibios.org/phpbb/viewtopic.php?f=2&t=872.
This method is working fine in my custom board with ARM Cortex M3 STM32F0 using SD3 (USART3), but when I use it in SD5 (UART5) this method doesn't work.
Configuration for both drivers.
Code: Select all
static SerialConfig SERIALtestcfg = {
57600,
0,
USART_CR2_STOP1_BITS | USART_CR2_LINEN,
0
};Code: Select all
static WORKING_AREA(myThreadWorkingArea, 128);
__attribute__((noreturn))
static msg_t myThread(void *arg) {
(void)arg;
chRegSetThreadName("radio");
EventListener elRadio;
chEvtRegisterMask((EventSource *)chnGetEventSource(&SD5), &elRadio, 1);
while (TRUE) {
flagsmask_t flags;
chEvtWaitOne(1);
chSysLock();
flags = chEvtGetAndClearFlagsI(&elRadio);
chSysUnlock();
chprintf((BaseSequentialStream *)&SD3, "Flags %d\r\n",
(uint16_t)flags);
if (flags & CHN_INPUT_AVAILABLE) {
palTogglePad(GPIOD, GPIOD_LED);
int32_t c = 0;
while (c != Q_TIMEOUT) {
c = chnGetTimeout(&SD5, TIME_IMMEDIATE);
}
}
}When there is input in SD3, the flag is
Code: Select all
CHN_INPUT_AVAILABLEAny help regarding this?
Thanks