diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-05-07 08:11:03 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-05-07 08:11:03 +0000 |
commit | bec915e05274a94f2b1a5e2443f04de826dd1f6e (patch) | |
tree | cec2044911766f5dc5a7bd8b8c9ffe0fe81734f8 /testhal/STM32F4xx/GPT/main.c | |
parent | 4afa0b98dff9eac6a94c104acf900e15147d2da3 (diff) | |
parent | b43c71424d201583822b26d13d11f7e3634cb515 (diff) | |
download | ChibiOS-bec915e05274a94f2b1a5e2443f04de826dd1f6e.tar.gz ChibiOS-bec915e05274a94f2b1a5e2443f04de826dd1f6e.tar.bz2 ChibiOS-bec915e05274a94f2b1a5e2443f04de826dd1f6e.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6916 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F4xx/GPT/main.c')
-rw-r--r-- | testhal/STM32F4xx/GPT/main.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/testhal/STM32F4xx/GPT/main.c b/testhal/STM32F4xx/GPT/main.c index a95d5fe81..88fb58e7d 100644 --- a/testhal/STM32F4xx/GPT/main.c +++ b/testhal/STM32F4xx/GPT/main.c @@ -20,13 +20,13 @@ /*
* GPT2 callback.
*/
-static void gpt2cb(GPTDriver *gptp) {
+static void gpt4cb(GPTDriver *gptp) {
(void)gptp;
palSetPad(GPIOD, GPIOD_LED5);
- chSysLockFromIsr();
+ chSysLockFromISR();
gptStartOneShotI(&GPTD3, 1000); /* 0.1 second pulse.*/
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
/*
@@ -41,9 +41,10 @@ static void gpt3cb(GPTDriver *gptp) { /*
* GPT2 configuration.
*/
-static const GPTConfig gpt2cfg = {
+static const GPTConfig gpt4cfg = {
10000, /* 10kHz timer clock.*/
- gpt2cb, /* Timer callback.*/
+ gpt4cb, /* Timer callback.*/
+ 0,
0
};
@@ -53,6 +54,7 @@ static const GPTConfig gpt2cfg = { static const GPTConfig gpt3cfg = {
10000, /* 10kHz timer clock.*/
gpt3cb, /* Timer callback.*/
+ 0,
0
};
@@ -74,8 +76,8 @@ int main(void) { /*
* Initializes the GPT drivers 2 and 3.
*/
- gptStart(&GPTD2, &gpt2cfg);
- gptPolledDelay(&GPTD2, 10); /* Small delay.*/
+ gptStart(&GPTD4, &gpt4cfg);
+ gptPolledDelay(&GPTD4, 10); /* Small delay.*/
gptStart(&GPTD3, &gpt3cfg);
gptPolledDelay(&GPTD3, 10); /* Small delay.*/
@@ -85,12 +87,12 @@ int main(void) { */
while (TRUE) {
palSetPad(GPIOD, GPIOD_LED4);
- gptStartContinuous(&GPTD2, 5000);
+ gptStartContinuous(&GPTD4, 5000);
chThdSleepMilliseconds(5000);
- gptStopTimer(&GPTD2);
+ gptStopTimer(&GPTD4);
palClearPad(GPIOD, GPIOD_LED4);
- gptStartContinuous(&GPTD2, 2500);
+ gptStartContinuous(&GPTD4, 2500);
chThdSleepMilliseconds(5000);
- gptStopTimer(&GPTD2);
+ gptStopTimer(&GPTD4);
}
}
|