aboutsummaryrefslogtreecommitdiffstats
path: root/demos/STM32
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-08-03 10:00:06 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-08-03 10:00:06 +0000
commit15e182dd827a48ab6f5f040f052ac201a915f2bc (patch)
treeec733cbeac8f07461b7f3a3bb83566618db44c65 /demos/STM32
parentb2ce02c741f7ccc43eedd0b301cd0dae36374aae (diff)
downloadChibiOS-15e182dd827a48ab6f5f040f052ac201a915f2bc.tar.gz
ChibiOS-15e182dd827a48ab6f5f040f052ac201a915f2bc.tar.bz2
ChibiOS-15e182dd827a48ab6f5f040f052ac201a915f2bc.zip
Added support for ports J and K to GPIOv2.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8149 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/STM32')
-rw-r--r--demos/STM32/RT-STM32F746G-DISCOVERY/main.c17
-rw-r--r--demos/STM32/RT-STM32F746G-DISCOVERY/mcuconf.h4
2 files changed, 9 insertions, 12 deletions
diff --git a/demos/STM32/RT-STM32F746G-DISCOVERY/main.c b/demos/STM32/RT-STM32F746G-DISCOVERY/main.c
index e7b5bd39c..dabc687cb 100644
--- a/demos/STM32/RT-STM32F746G-DISCOVERY/main.c
+++ b/demos/STM32/RT-STM32F746G-DISCOVERY/main.c
@@ -20,7 +20,7 @@
/*
* This is a periodic thread that does absolutely nothing except flashing
- * a LED.
+ * a LED attached to TP1.
*/
static THD_WORKING_AREA(waThread1, 128);
static THD_FUNCTION(Thread1, arg) {
@@ -28,9 +28,9 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
while (true) {
- palSetPad(GPIOD, GPIOD_LED3); /* Orange. */
+ palSetPad(GPIOH, GPIOH_TP1);
chThdSleepMilliseconds(500);
- palClearPad(GPIOD, GPIOD_LED3); /* Orange. */
+ palClearPad(GPIOH, GPIOH_TP1);
chThdSleepMilliseconds(500);
}
}
@@ -51,12 +51,9 @@ int main(void) {
chSysInit();
/*
- * Activates the serial driver 2 using the driver default configuration.
- * PA2(TX) and PA3(RX) are routed to USART2.
+ * Activates the serial driver 1 using the driver default configuration.
*/
- sdStart(&SD2, NULL);
- palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7));
- palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7));
+ sdStart(&SD1, NULL);
/*
* Creates the example thread.
@@ -68,8 +65,8 @@ int main(void) {
* sleeping in a loop and check the button state.
*/
while (true) {
- if (palReadPad(GPIOA, GPIOA_BUTTON))
- TestThread(&SD2);
+ if (palReadPad(GPIOI, GPIOI_BUTTON_USER))
+ TestThread(&SD1);
chThdSleepMilliseconds(500);
}
}
diff --git a/demos/STM32/RT-STM32F746G-DISCOVERY/mcuconf.h b/demos/STM32/RT-STM32F746G-DISCOVERY/mcuconf.h
index 1dc779067..99291770a 100644
--- a/demos/STM32/RT-STM32F746G-DISCOVERY/mcuconf.h
+++ b/demos/STM32/RT-STM32F746G-DISCOVERY/mcuconf.h
@@ -257,8 +257,8 @@
/*
* SERIAL driver system settings.
*/
-#define STM32_SERIAL_USE_USART1 FALSE
-#define STM32_SERIAL_USE_USART2 TRUE
+#define STM32_SERIAL_USE_USART1 TRUE
+#define STM32_SERIAL_USE_USART2 FALSE
#define STM32_SERIAL_USE_USART3 FALSE
#define STM32_SERIAL_USE_UART4 FALSE
#define STM32_SERIAL_USE_UART5 FALSE