git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1463 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2009-12-24 09:38:50 +00:00
parent 8f30bbcc34
commit 0873332c30
4 changed files with 22 additions and 22 deletions

View File

@ -21,7 +21,7 @@ CC = $(TRGT)gcc
AS = $(TRGT)gcc -x assembler-with-cpp AS = $(TRGT)gcc -x assembler-with-cpp
# List all default C defines here, like -D_DEBUG=1 # 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 # List all default ASM defines here, like -D_DEBUG=1
DADEFS = DADEFS =

View File

@ -28,7 +28,7 @@
#define CONSOLE_WA_SIZE THD_WA_SIZE(4096) #define CONSOLE_WA_SIZE THD_WA_SIZE(4096)
#define TEST_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 *cdtp;
static Thread *shelltp1; static Thread *shelltp1;
@ -94,7 +94,7 @@ static void termination_handler(eventid_t id) {
chThdWait(shelltp1); chThdWait(shelltp1);
shelltp1 = NULL; shelltp1 = NULL;
chThdSleepMilliseconds(10); chThdSleepMilliseconds(10);
cprint("Init: shell on SD1 terminated\n"); cputs("Init: shell on SD1 terminated");
chSysLock(); chSysLock();
chOQResetI(&SD1.d2.oqueue); chOQResetI(&SD1.d2.oqueue);
chSysUnlock(); chSysUnlock();
@ -103,7 +103,7 @@ static void termination_handler(eventid_t id) {
chThdWait(shelltp2); chThdWait(shelltp2);
shelltp2 = NULL; shelltp2 = NULL;
chThdSleepMilliseconds(10); chThdSleepMilliseconds(10);
cprint("Init: shell on SD2 terminated\n"); cputs("Init: shell on SD2 terminated");
chSysLock(); chSysLock();
chOQResetI(&SD2.d2.oqueue); chOQResetI(&SD2.d2.oqueue);
chSysUnlock(); chSysUnlock();
@ -122,11 +122,11 @@ static void sd1_handler(eventid_t id) {
(void)id; (void)id;
flags = sdGetAndClearFlags(&SD1); flags = sdGetAndClearFlags(&SD1);
if ((flags & SD_CONNECTED) && (shelltp1 == NULL)) { 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); shelltp1 = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO + 1);
} }
if (flags & SD_DISCONNECTED) { if (flags & SD_DISCONNECTED) {
cprint("Init: disconnection on SD1\n"); cputs("Init: disconnection on SD1");
chSysLock(); chSysLock();
chIQResetI(&SD1.d2.iqueue); chIQResetI(&SD1.d2.iqueue);
chSysUnlock(); chSysUnlock();
@ -145,11 +145,11 @@ static void sd2_handler(eventid_t id) {
(void)id; (void)id;
flags = sdGetAndClearFlags(&SD2); flags = sdGetAndClearFlags(&SD2);
if ((flags & SD_CONNECTED) && (shelltp2 == NULL)) { 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); shelltp2 = shellCreate(&shell_cfg2, SHELL_WA_SIZE, NORMALPRIO + 10);
} }
if (flags & SD_DISCONNECTED) { if (flags & SD_DISCONNECTED) {
cprint("Init: disconnection on SD2\n"); cputs("Init: disconnection on SD2");
chSysLock(); chSysLock();
chIQResetI(&SD2.d2.iqueue); chIQResetI(&SD2.d2.iqueue);
chSysUnlock(); chSysUnlock();
@ -199,11 +199,11 @@ int main(void) {
/* /*
* Initializing connection/disconnection events. * Initializing connection/disconnection events.
*/ */
cprint("Shell service started on SD1, SD2\n"); cputs("Shell service started on SD1, SD2");
cprint(" - Listening for connections on SD1\n"); cputs(" - Listening for connections on SD1");
(void) sdGetAndClearFlags(&SD1); (void) sdGetAndClearFlags(&SD1);
chEvtRegister(&SD1.d2.sevent, &sd1fel, 1); chEvtRegister(&SD1.d2.sevent, &sd1fel, 1);
cprint(" - Listening for connections on SD2\n"); cputs(" - Listening for connections on SD2");
(void) sdGetAndClearFlags(&SD2); (void) sdGetAndClearFlags(&SD2);
chEvtRegister(&SD2.d2.sevent, &sd2fel, 2); chEvtRegister(&SD2.d2.sevent, &sd2fel, 2);

View File

@ -189,7 +189,7 @@ void test_cpu_pulse(unsigned duration) {
end = start + MS2ST(duration); end = start + MS2ST(duration);
do { do {
now = chThdSelf()->p_time; now = chThdSelf()->p_time;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} }

View File

@ -81,7 +81,7 @@ static unsigned int msg_loop_test(Thread *tp) {
do { do {
(void)chMsgSend(tp, 1); (void)chMsgSend(tp, 1);
n++; n++;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} while (!test_timer_done); } while (!test_timer_done);
@ -248,7 +248,7 @@ static void bmk4_execute(void) {
chSchWakeupS(tp, RDY_OK); chSchWakeupS(tp, RDY_OK);
chSysUnlock(); chSysUnlock();
n += 4; n += 4;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} while (!test_timer_done); } while (!test_timer_done);
@ -295,7 +295,7 @@ static void bmk5_execute(void) {
do { do {
chThdWait(chThdCreateStatic(wap, WA_SIZE, prio, thread2, NULL)); chThdWait(chThdCreateStatic(wap, WA_SIZE, prio, thread2, NULL));
n++; n++;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} while (!test_timer_done); } while (!test_timer_done);
@ -339,7 +339,7 @@ static void bmk6_execute(void) {
do { do {
chThdCreateStatic(wap, WA_SIZE, prio, thread2, NULL); chThdCreateStatic(wap, WA_SIZE, prio, thread2, NULL);
n++; n++;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} while (!test_timer_done); } while (!test_timer_done);
@ -399,7 +399,7 @@ static void bmk7_execute(void) {
do { do {
chSemReset(&sem1, 0); chSemReset(&sem1, 0);
n++; n++;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} while (!test_timer_done); } while (!test_timer_done);
@ -439,7 +439,7 @@ static msg_t thread8(void *p) {
chThdYield(); chThdYield();
chThdYield(); chThdYield();
(*(uint32_t *)p) += 4; (*(uint32_t *)p) += 4;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} while(!chThdShouldTerminate()); } while(!chThdShouldTerminate());
@ -514,7 +514,7 @@ static void bmk9_execute(void) {
(void)chIQGet(&iq); (void)chIQGet(&iq);
(void)chIQGet(&iq); (void)chIQGet(&iq);
n++; n++;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} while (!test_timer_done); } while (!test_timer_done);
@ -560,7 +560,7 @@ static void bmk10_execute(void) {
chVTResetI(&vt2); chVTResetI(&vt2);
chSysUnlock(); chSysUnlock();
n++; n++;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} while (!test_timer_done); } while (!test_timer_done);
@ -611,7 +611,7 @@ static void bmk11_execute(void) {
chSemWait(&sem1); chSemWait(&sem1);
chSemSignal(&sem1); chSemSignal(&sem1);
n++; n++;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} while (!test_timer_done); } while (!test_timer_done);
@ -663,7 +663,7 @@ static void bmk12_execute(void) {
chMtxLock(&mtx1); chMtxLock(&mtx1);
chMtxUnlock(); chMtxUnlock();
n++; n++;
#if defined(WIN32) #if defined(SIMULATOR)
ChkIntSources(); ChkIntSources();
#endif #endif
} while (!test_timer_done); } while (!test_timer_done);