aboutsummaryrefslogtreecommitdiffstats
path: root/demos/Posix-GCC/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/Posix-GCC/main.c')
-rw-r--r--demos/Posix-GCC/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/demos/Posix-GCC/main.c b/demos/Posix-GCC/main.c
index afab51319..bcdc6636b 100644
--- a/demos/Posix-GCC/main.c
+++ b/demos/Posix-GCC/main.c
@@ -149,16 +149,18 @@ static void termination_handler(eventid_t id) {
}
}
+static EventListener sd1fel, sd2fel;
+
/**
* @brief SD1 status change handler.
*
* @param[in] id event id.
*/
static void sd1_handler(eventid_t id) {
- chnflags_t flags;
+ flagsmask_t flags;
(void)id;
- flags = chnGetAndClearFlags(&SD1);
+ flags = chEvtGetAndClearFlags(&sd1fel);
if ((flags & CHN_CONNECTED) && (shelltp1 == NULL)) {
cputs("Init: connection on SD1");
shelltp1 = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO + 1);
@@ -177,10 +179,10 @@ static void sd1_handler(eventid_t id) {
* @param[in] id event id.
*/
static void sd2_handler(eventid_t id) {
- chnflags_t flags;
+ flagsmask_t flags;
(void)id;
- flags = chnGetAndClearFlags(&SD2);
+ flags = chEvtGetAndClearFlags(&sd2fel);
if ((flags & CHN_CONNECTED) && (shelltp2 == NULL)) {
cputs("Init: connection on SD2");
shelltp2 = shellCreate(&shell_cfg2, SHELL_WA_SIZE, NORMALPRIO + 10);
@@ -238,10 +240,8 @@ int main(void) {
*/
cputs("Shell service started on SD1, SD2");
cputs(" - Listening for connections on SD1");
- (void) chnGetAndClearFlags(&SD1);
chEvtRegister(chnGetEventSource(&SD1), &sd1fel, 1);
cputs(" - Listening for connections on SD2");
- (void) chnGetAndClearFlags(&SD2);
chEvtRegister(chnGetEventSource(&SD2), &sd2fel, 2);
/*