diff options
author | isiora <none@example.com> | 2017-11-16 10:36:56 +0000 |
---|---|---|
committer | isiora <none@example.com> | 2017-11-16 10:36:56 +0000 |
commit | 7037d2fa6cb8326a05852bf22062257dba0c5a48 (patch) | |
tree | c52564b3e7381c20a6a4613bec093d714194b49a | |
parent | e1c25514093a340ee91e9afefb22c0acee03eaf2 (diff) | |
download | ChibiOS-7037d2fa6cb8326a05852bf22062257dba0c5a48.tar.gz ChibiOS-7037d2fa6cb8326a05852bf22062257dba0c5a48.tar.bz2 ChibiOS-7037d2fa6cb8326a05852bf22062257dba0c5a48.zip |
Changed SD0 to SD1 and default speed
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11016 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rwxr-xr-x | demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/main.c | 18 | ||||
-rw-r--r-- | demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/mcuconf.h | 4 |
2 files changed, 14 insertions, 8 deletions
diff --git a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/main.c b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/main.c index 176745464..13188b981 100755 --- a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/main.c +++ b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/main.c @@ -34,6 +34,12 @@ static THD_FUNCTION(Thread1, arg) { }
}
+static const SerialConfig sdcfg = {
+ 115200,
+ 0,
+ UART_MR_PAR_NO
+};
+
/*
* Application entry point.
*/
@@ -52,11 +58,11 @@ int main(void) { /*
* Activates the serial driver 0 using the driver default configuration.
*/
- sdStart(&SD0, NULL);
+ sdStart(&SD1, &sdcfg);
- /* Redirecting UART0 RX on PB26 and UART0 TX on PB 27. */
- palSetGroupMode(PIOB, PAL_PORT_BIT(26) | PAL_PORT_BIT(27), 0U,
- PAL_SAMA_FUNC_PERIPH_C | PAL_MODE_SECURE);
+ /* Redirecting UART0 RX on PD2 and UART0 TX on PD3. */
+ palSetGroupMode(PIOD, PAL_PORT_BIT(2) | PAL_PORT_BIT(3), 0U,
+ PAL_SAMA_FUNC_PERIPH_A | PAL_MODE_SECURE);
/*
* Creates the blinker thread.
*/
@@ -68,8 +74,8 @@ int main(void) { */
while (true) {
if(!palReadPad(PIOB, PIOB_USER_PB)) {
- test_execute((BaseSequentialStream *)&SD0, &rt_test_suite);
- test_execute((BaseSequentialStream *)&SD0, &oslib_test_suite);
+ test_execute((BaseSequentialStream *)&SD1, &rt_test_suite);
+ test_execute((BaseSequentialStream *)&SD1, &oslib_test_suite);
}
chThdSleepMilliseconds(500);
}
diff --git a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/mcuconf.h b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/mcuconf.h index a5514c263..3c9f0dbc6 100644 --- a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/mcuconf.h +++ b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/mcuconf.h @@ -57,8 +57,8 @@ /*
* SERIAL driver system settings.
*/
-#define SAMA_SERIAL_USE_UART0 TRUE
-#define SAMA_SERIAL_USE_UART1 FALSE
+#define SAMA_SERIAL_USE_UART0 FALSE
+#define SAMA_SERIAL_USE_UART1 TRUE
#define SAMA_SERIAL_USE_UART2 FALSE
#define SAMA_SERIAL_USE_UART3 FALSE
#define SAMA_SERIAL_USE_UART4 FALSE
|