diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-15 14:43:36 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-15 14:43:36 +0000 |
commit | 46538d795be83d1d54b132e7d57213cb6d975c51 (patch) | |
tree | 65cafed4cc1506a8322fe1a077b151540ef8eb45 /testhal/STM32F1xx/MAC/main.c | |
parent | adb989bc17a879e51dbd9aeb471089af1f9d73e2 (diff) | |
download | ChibiOS-46538d795be83d1d54b132e7d57213cb6d975c51.tar.gz ChibiOS-46538d795be83d1d54b132e7d57213cb6d975c51.tar.bz2 ChibiOS-46538d795be83d1d54b132e7d57213cb6d975c51.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3319 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F1xx/MAC/main.c')
-rw-r--r-- | testhal/STM32F1xx/MAC/main.c | 72 |
1 files changed, 2 insertions, 70 deletions
diff --git a/testhal/STM32F1xx/MAC/main.c b/testhal/STM32F1xx/MAC/main.c index fc82a7786..6e6081162 100644 --- a/testhal/STM32F1xx/MAC/main.c +++ b/testhal/STM32F1xx/MAC/main.c @@ -21,71 +21,6 @@ #include "ch.h"
#include "hal.h"
-static VirtualTimer vt;
-
-/* LED set to OFF after 200mS.*/
-static void ledoff(void *arg) {
-
- (void)arg;
- palSetPad(GPIOC, GPIOC_LED);
-}
-
-/* Triggered when the button is pressed or released. The LED is set to ON.*/
-static void extcb1(EXTDriver *extp, expchannel_t channel) {
-
- (void)extp;
- (void)channel;
- palClearPad(GPIOC, GPIOC_LED);
- chSysLockFromIsr();
- if (!chVTIsArmedI(&vt))
- chVTSetI(&vt, MS2ST(200), ledoff, NULL);
- chSysUnlockFromIsr();
-}
-
-/* Triggered when the LED goes OFF.*/
-static void extcb2(EXTDriver *extp, expchannel_t channel) {
-
- (void)extp;
- (void)channel;
-}
-
-static const EXTConfig extcfg = {
- {
- {EXT_CH_MODE_BOTH_EDGES | EXT_CH_MODE_AUTOSTART, extcb1},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART, extcb2},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- {EXT_CH_MODE_DISABLED, NULL},
- },
- EXT_MODE_EXTI(EXT_MODE_GPIOA,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- EXT_MODE_GPIOC,
- 0,
- 0,
- 0)
-};
-
/*
* Application entry point.
*/
@@ -104,16 +39,13 @@ int main(void) { /*
* Activates the EXT driver 1.
*/
- extStart(&EXTD1, &extcfg);
+/* macStart(ÐD1, NULL);*/
/*
* Normal main() thread activity, in this demo it enables and disables the
* button EXT channel using 5 seconds intervals.
*/
while (TRUE) {
- chThdSleepMilliseconds(5000);
- extChannelDisable(&EXTD1, 0);
- chThdSleepMilliseconds(5000);
- extChannelEnable(&EXTD1, 0);
+ chThdSleepMilliseconds(500);
}
}
|