diff options
-rw-r--r-- | demos/GNU-Linux-GCC/Makefile | 2 | ||||
-rw-r--r-- | demos/GNU-Linux-GCC/main.c | 20 | ||||
-rw-r--r-- | test/test.c | 2 | ||||
-rw-r--r-- | test/testbmk.c | 20 |
4 files changed, 22 insertions, 22 deletions
diff --git a/demos/GNU-Linux-GCC/Makefile b/demos/GNU-Linux-GCC/Makefile index 6e433a990..9d38e2637 100644 --- a/demos/GNU-Linux-GCC/Makefile +++ b/demos/GNU-Linux-GCC/Makefile @@ -21,7 +21,7 @@ CC = $(TRGT)gcc AS = $(TRGT)gcc -x assembler-with-cpp
# List all default C defines here, like -D_DEBUG=1
-DDEFS = -DSHELL_USE_IPRINTF=FALSE
+DDEFS = -DSIMULATOR -DSHELL_USE_IPRINTF=FALSE
# List all default ASM defines here, like -D_DEBUG=1
DADEFS =
diff --git a/demos/GNU-Linux-GCC/main.c b/demos/GNU-Linux-GCC/main.c index c969f2208..4153b219a 100644 --- a/demos/GNU-Linux-GCC/main.c +++ b/demos/GNU-Linux-GCC/main.c @@ -28,7 +28,7 @@ #define CONSOLE_WA_SIZE THD_WA_SIZE(4096)
#define TEST_WA_SIZE THD_WA_SIZE(4096)
-#define cprint(msg) chMsgSend(cdtp, (msg_t)msg)
+#define cputs(msg) chMsgSend(cdtp, (msg_t)msg)
static Thread *cdtp;
static Thread *shelltp1;
@@ -94,7 +94,7 @@ static void termination_handler(eventid_t id) { chThdWait(shelltp1);
shelltp1 = NULL;
chThdSleepMilliseconds(10);
- cprint("Init: shell on SD1 terminated\n");
+ cputs("Init: shell on SD1 terminated");
chSysLock();
chOQResetI(&SD1.d2.oqueue);
chSysUnlock();
@@ -103,7 +103,7 @@ static void termination_handler(eventid_t id) { chThdWait(shelltp2);
shelltp2 = NULL;
chThdSleepMilliseconds(10);
- cprint("Init: shell on SD2 terminated\n");
+ cputs("Init: shell on SD2 terminated");
chSysLock();
chOQResetI(&SD2.d2.oqueue);
chSysUnlock();
@@ -122,11 +122,11 @@ static void sd1_handler(eventid_t id) { (void)id;
flags = sdGetAndClearFlags(&SD1);
if ((flags & SD_CONNECTED) && (shelltp1 == NULL)) {
- cprint("Init: connection on SD1\n");
+ cputs("Init: connection on SD1");
shelltp1 = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO + 1);
}
if (flags & SD_DISCONNECTED) {
- cprint("Init: disconnection on SD1\n");
+ cputs("Init: disconnection on SD1");
chSysLock();
chIQResetI(&SD1.d2.iqueue);
chSysUnlock();
@@ -145,11 +145,11 @@ static void sd2_handler(eventid_t id) { (void)id;
flags = sdGetAndClearFlags(&SD2);
if ((flags & SD_CONNECTED) && (shelltp2 == NULL)) {
- cprint("Init: connection on SD2\n");
+ cputs("Init: connection on SD2");
shelltp2 = shellCreate(&shell_cfg2, SHELL_WA_SIZE, NORMALPRIO + 10);
}
if (flags & SD_DISCONNECTED) {
- cprint("Init: disconnection on SD2\n");
+ cputs("Init: disconnection on SD2");
chSysLock();
chIQResetI(&SD2.d2.iqueue);
chSysUnlock();
@@ -199,11 +199,11 @@ int main(void) { /*
* Initializing connection/disconnection events. */
- cprint("Shell service started on SD1, SD2\n");
- cprint(" - Listening for connections on SD1\n");
+ cputs("Shell service started on SD1, SD2");
+ cputs(" - Listening for connections on SD1");
(void) sdGetAndClearFlags(&SD1);
chEvtRegister(&SD1.d2.sevent, &sd1fel, 1);
- cprint(" - Listening for connections on SD2\n");
+ cputs(" - Listening for connections on SD2");
(void) sdGetAndClearFlags(&SD2);
chEvtRegister(&SD2.d2.sevent, &sd2fel, 2);
diff --git a/test/test.c b/test/test.c index f4272ca14..623545318 100644 --- a/test/test.c +++ b/test/test.c @@ -189,7 +189,7 @@ void test_cpu_pulse(unsigned duration) { end = start + MS2ST(duration);
do {
now = chThdSelf()->p_time;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
}
diff --git a/test/testbmk.c b/test/testbmk.c index 35a193221..89a50cd9d 100644 --- a/test/testbmk.c +++ b/test/testbmk.c @@ -81,7 +81,7 @@ static unsigned int msg_loop_test(Thread *tp) { do {
(void)chMsgSend(tp, 1);
n++;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
} while (!test_timer_done);
@@ -248,7 +248,7 @@ static void bmk4_execute(void) { chSchWakeupS(tp, RDY_OK);
chSysUnlock();
n += 4;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
} while (!test_timer_done);
@@ -295,7 +295,7 @@ static void bmk5_execute(void) { do {
chThdWait(chThdCreateStatic(wap, WA_SIZE, prio, thread2, NULL));
n++;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
} while (!test_timer_done);
@@ -339,7 +339,7 @@ static void bmk6_execute(void) { do {
chThdCreateStatic(wap, WA_SIZE, prio, thread2, NULL);
n++;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
} while (!test_timer_done);
@@ -399,7 +399,7 @@ static void bmk7_execute(void) { do {
chSemReset(&sem1, 0);
n++;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
} while (!test_timer_done);
@@ -439,7 +439,7 @@ static msg_t thread8(void *p) { chThdYield();
chThdYield();
(*(uint32_t *)p) += 4;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
} while(!chThdShouldTerminate());
@@ -514,7 +514,7 @@ static void bmk9_execute(void) { (void)chIQGet(&iq);
(void)chIQGet(&iq);
n++;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
} while (!test_timer_done);
@@ -560,7 +560,7 @@ static void bmk10_execute(void) { chVTResetI(&vt2);
chSysUnlock();
n++;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
} while (!test_timer_done);
@@ -611,7 +611,7 @@ static void bmk11_execute(void) { chSemWait(&sem1);
chSemSignal(&sem1);
n++;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
} while (!test_timer_done);
@@ -663,7 +663,7 @@ static void bmk12_execute(void) { chMtxLock(&mtx1);
chMtxUnlock();
n++;
-#if defined(WIN32)
+#if defined(SIMULATOR)
ChkIntSources();
#endif
} while (!test_timer_done);
|