diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-08-19 15:07:47 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-08-19 15:07:47 +0000 |
commit | a042a8234acfdce62f65a5c72112f3256fade060 (patch) | |
tree | fab52fdade992466c216926e26f869d4d50f4fe3 /testhal/STM32F30x/IRQ_STORM/main.c | |
parent | 79ad42bc2b8e9013d0a02a9d758fa8af36322b27 (diff) | |
download | ChibiOS-a042a8234acfdce62f65a5c72112f3256fade060.tar.gz ChibiOS-a042a8234acfdce62f65a5c72112f3256fade060.tar.bz2 ChibiOS-a042a8234acfdce62f65a5c72112f3256fade060.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6183 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F30x/IRQ_STORM/main.c')
-rw-r--r-- | testhal/STM32F30x/IRQ_STORM/main.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/testhal/STM32F30x/IRQ_STORM/main.c b/testhal/STM32F30x/IRQ_STORM/main.c index 554faa6fb..21684a868 100644 --- a/testhal/STM32F30x/IRQ_STORM/main.c +++ b/testhal/STM32F30x/IRQ_STORM/main.c @@ -46,12 +46,12 @@ #define MSG_SEND_LEFT 0
#define MSG_SEND_RIGHT 1
-static bool_t saturated;
+static bool 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();
}
/*
@@ -221,14 +221,14 @@ int main(void) { /*
* Activates GPTs.
*/
- gptStart(&GPTD2, &gpt2cfg);
+ gptStart(&GPTD4, &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);
}
@@ -291,10 +291,10 @@ int main(void) { saturated = FALSE;
threshold = 0;
for (interval = 2000; interval >= 10; interval -= interval / 10) {
- gptStartContinuous(&GPTD2, interval - 1); /* Slightly out of phase.*/
+ gptStartContinuous(&GPTD4, interval - 1); /* Slightly out of phase.*/
gptStartContinuous(&GPTD3, interval + 1); /* Slightly out of phase.*/
chThdSleepMilliseconds(1000);
- gptStopTimer(&GPTD2);
+ gptStopTimer(&GPTD4);
gptStopTimer(&GPTD3);
if (!saturated)
print(".");
@@ -315,7 +315,7 @@ int main(void) { if (threshold > worst)
worst = threshold;
}
- gptStopTimer(&GPTD2);
+ gptStopTimer(&GPTD4);
gptStopTimer(&GPTD3);
print("Worst case at ");
|