diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-09-16 09:08:43 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-09-16 09:08:43 +0000 |
commit | f90a0f37906a9363a6e702d8ac1c4c8257370efa (patch) | |
tree | df0521c93a97691638a0227a17c64ddfc59d1080 /demos | |
parent | dfb876b3a1263c627465dfc6e3b76d5bab6c052e (diff) | |
download | ChibiOS-f90a0f37906a9363a6e702d8ac1c4c8257370efa.tar.gz ChibiOS-f90a0f37906a9363a6e702d8ac1c4c8257370efa.tar.bz2 ChibiOS-f90a0f37906a9363a6e702d8ac1c4c8257370efa.zip |
Removed flags handling in BaseAsynchronousChannel. Modified serial drivers to use the new event flags.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4671 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r-- | demos/Posix-GCC/main.c | 12 | ||||
-rw-r--r-- | demos/Win32-MinGW/main.c | 14 |
2 files changed, 13 insertions, 13 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);
/*
diff --git a/demos/Win32-MinGW/main.c b/demos/Win32-MinGW/main.c index dc6e3685a..7514faebf 100644 --- a/demos/Win32-MinGW/main.c +++ b/demos/Win32-MinGW/main.c @@ -147,16 +147,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);
@@ -175,10 +177,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);
@@ -201,7 +203,7 @@ static evhandler_t fhandlers[] = { * Simulator main. *
*------------------------------------------------------------------------*/
int main(void) {
- EventListener sd1fel, sd2fel, tel;
+ EventListener tel;
/*
* System initializations.
@@ -236,10 +238,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);
/*
|