aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/multi/QSPI-MFS/main.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-11-16 14:23:28 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-11-16 14:23:28 +0000
commitd7ce59dc3cb5f1ea14807320ca7031f1e17e8f37 (patch)
treed867972d5ed03e7fb29c47a94b9e67c97c5b0835 /testhal/STM32/multi/QSPI-MFS/main.c
parent7037d2fa6cb8326a05852bf22062257dba0c5a48 (diff)
downloadChibiOS-d7ce59dc3cb5f1ea14807320ca7031f1e17e8f37.tar.gz
ChibiOS-d7ce59dc3cb5f1ea14807320ca7031f1e17e8f37.tar.bz2
ChibiOS-d7ce59dc3cb5f1ea14807320ca7031f1e17e8f37.zip
First MFS test sequence complete, starting debug.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11017 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/multi/QSPI-MFS/main.c')
-rw-r--r--testhal/STM32/multi/QSPI-MFS/main.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/testhal/STM32/multi/QSPI-MFS/main.c b/testhal/STM32/multi/QSPI-MFS/main.c
index 870153684..638f8d807 100644
--- a/testhal/STM32/multi/QSPI-MFS/main.c
+++ b/testhal/STM32/multi/QSPI-MFS/main.c
@@ -22,6 +22,10 @@
#include "m25q.h"
#include "mfs.h"
+#include "mfs_test_root.h"
+
+#include "portab.h"
+
/* 16MB device, 2 cycles delay after NCS.*/
const QSPIConfig qspicfg1 = {
NULL,
@@ -61,8 +65,6 @@ const M25QConfig m25qcfg1 = {
&qspicfg1
};
-MFSDriver mfs;
-
const MFSConfig mfscfg1 = {
(BaseFlash *)&m25q,
0xFFFFFFFFU,
@@ -81,9 +83,9 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
while (true) {
- palToggleLine(LINE_LED_GREEN);
+ palToggleLine(PORTAB_LINE_LED1);
chThdSleepMilliseconds(500);
- palToggleLine(LINE_LED_GREEN);
+ palToggleLine(PORTAB_LINE_LED1);
chThdSleepMilliseconds(500);
}
}
@@ -92,7 +94,6 @@ static THD_FUNCTION(Thread1, arg) {
* Application entry point.
*/
int main(void) {
- mfs_error_t err;
/*
* System initializations.
@@ -105,39 +106,27 @@ int main(void) {
chSysInit();
/*
- * LED line as output.
+ * Board-dependent GPIO setup code.
*/
- palSetLineMode(LINE_LED_GREEN, PAL_MODE_OUTPUT_PUSHPULL);
+ portab_setup();
/*
- * Creates the blinker thread.
+ * Starting a serial port for test report output.
*/
- chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO + 1, Thread1, NULL);
-
- /* Initializing and starting M25Q driver.*/
- m25qObjectInit(&m25q);
- m25qStart(&m25q, &m25qcfg1);
-
- /* Mounting the MFS volume defined in the configuration.*/
- mfsObjectInit(&mfs);
- err = mfsStart(&mfs, &mfscfg1);
- err = mfsErase(&mfs);
+ sdStart(&PORTAB_SD1, NULL);
- err = mfsWriteRecord(&mfs, 1, 64, pattern);
- err = mfsWriteRecord(&mfs, 2, 64, pattern);
- err = mfsWriteRecord(&mfs, 1, 128, pattern);
- err = mfsWriteRecord(&mfs, 2, 128, pattern);
-
- err = mfsPerformGarbageCollection(&mfs);
-
- mfsStop(&mfs);
-
- (void)err;
+ /*
+ * Creates the blinker thread.
+ */
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
/*
* Normal main() thread activity, in this demo it does nothing.
*/
while (true) {
+ if (palReadLine(PORTAB_LINE_BUTTON) == PORTAB_BUTTON_PRESSED) {
+ test_execute((BaseSequentialStream *)&PORTAB_SD1, &mfs_test_suite);
+ }
chThdSleepMilliseconds(500);
}
return 0;