diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-08-20 14:49:49 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-08-20 14:49:49 +0000 |
commit | 371ef2afb5b7045d8293dd5a393a7783b025f8a8 (patch) | |
tree | d28a31a6d32d6d02cead54a8438556235635f0d6 /testhal/STM32F0xx/IRQ_STORM/main.c | |
parent | 8d0dc4bfd67857f376a2aa67424e9e8697342025 (diff) | |
download | ChibiOS-371ef2afb5b7045d8293dd5a393a7783b025f8a8.tar.gz ChibiOS-371ef2afb5b7045d8293dd5a393a7783b025f8a8.tar.bz2 ChibiOS-371ef2afb5b7045d8293dd5a393a7783b025f8a8.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6191 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F0xx/IRQ_STORM/main.c')
-rw-r--r-- | testhal/STM32F0xx/IRQ_STORM/main.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/testhal/STM32F0xx/IRQ_STORM/main.c b/testhal/STM32F0xx/IRQ_STORM/main.c index 4a11fcad8..a6fd57121 100644 --- a/testhal/STM32F0xx/IRQ_STORM/main.c +++ b/testhal/STM32F0xx/IRQ_STORM/main.c @@ -51,7 +51,7 @@ static bool_t saturated; /*
* Mailboxes and buffers.
*/
-static Mailbox mb[NUM_THREADS];
+static mailbox_t mb[NUM_THREADS];
static msg_t b[NUM_THREADS][MAILBOX_SIZE];
/*
@@ -101,7 +101,7 @@ static msg_t WorkerThread(void *arg) { /* If this thread is not at the end of a chain re-sending the message,
note this check works because the variable target is unsigned.*/
msg = chMBPost(&mb[target], msg, TIME_IMMEDIATE);
- if (msg != RDY_OK)
+ if (msg != MSG_OK)
saturated = TRUE;
}
else {
@@ -121,11 +121,11 @@ static void gpt2cb(GPTDriver *gptp) { msg_t msg;
(void)gptp;
- chSysLockFromIsr();
+ chSysLockFromISR();
msg = chMBPostI(&mb[0], MSG_SEND_RIGHT);
- if (msg != RDY_OK)
+ if (msg != MSG_OK)
saturated = TRUE;
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
/*
@@ -135,11 +135,11 @@ static void gpt3cb(GPTDriver *gptp) { msg_t msg;
(void)gptp;
- chSysLockFromIsr();
+ chSysLockFromISR();
msg = chMBPostI(&mb[NUM_THREADS - 1], MSG_SEND_LEFT);
- if (msg != RDY_OK)
+ if (msg != MSG_OK)
saturated = TRUE;
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
/*
@@ -217,14 +217,14 @@ int main(void) { sdStart(&SD1, NULL);
palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(1)); /* USART1 TX. */
palSetPadMode(GPIOA, 10, PAL_MODE_ALTERNATE(1)); /* USART1 RX. */
- gptStart(&GPTD2, &gpt2cfg);
+ gptStart(&GPTD1, &gpt2cfg);
gptStart(&GPTD3, &gpt3cfg);
/*
* Initializes the mailboxes and creates the worker threads.
*/
for (i = 0; i < NUM_THREADS; i++) {
- chMBInit(&mb[i], b[i], MAILBOX_SIZE);
+ chMBObjectInit(&mb[i], b[i], MAILBOX_SIZE);
chThdCreateStatic(waWorkerThread[i], sizeof waWorkerThread[i],
NORMALPRIO - 20, WorkerThread, (void *)i);
}
@@ -287,10 +287,10 @@ int main(void) { saturated = FALSE;
threshold = 0;
for (interval = 2000; interval >= 20; interval -= interval / 10) {
- gptStartContinuous(&GPTD2, interval - 1); /* Slightly out of phase.*/
+ gptStartContinuous(&GPTD1, interval - 1); /* Slightly out of phase.*/
gptStartContinuous(&GPTD3, interval + 1); /* Slightly out of phase.*/
chThdSleepMilliseconds(1000);
- gptStopTimer(&GPTD2);
+ gptStopTimer(&GPTD1);
gptStopTimer(&GPTD3);
if (!saturated)
print(".");
@@ -311,7 +311,7 @@ int main(void) { if (threshold > worst)
worst = threshold;
}
- gptStopTimer(&GPTD2);
+ gptStopTimer(&GPTD1);
gptStopTimer(&GPTD3);
print("Worst case at ");
|