hi to all, i'm newbie of embedded word i have this problem write this thread in chibiOS
static THD_WORKING_AREA(waRead5, 128);
static THD_FUNCTION(Thread5,arg) {
(void)arg;
chRegSetThreadName("th_Buffer");
palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(7));
palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(7));
sdStart(&SD1, NULL);
event_listener_t Uart1Data;
eventmask_t flags;
chEvtRegisterMask((event_source_t *)chnGetEventSource(&SD1), &Uart1Data, EVENT_MASK(1));
while (TRUE) {
chEvtWaitAll(EVENT_MASK(1));
flags =chEvtGetAndClearFlags(&Uart1Data);
if (flags & CHN_INPUT_AVAILABLE)
{
sdWrite(&SD2,"OK\r\n",4);
}
}
}
i want start a event when arrived data on SD1, in this code when arrive data on SD1 i write ok on SD2
i have this strange situation if i press reset the board and later i press button i see the event but later this i don't see nothing,
i use chEvtGetAndClearFlags for clear the flags but don't work
can you help me?
best regards
A.