aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32L4xx
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-05-20 09:53:06 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-05-20 09:53:06 +0000
commit6d8322126585801381cf3974753c40aacc89d845 (patch)
tree96f3d7168231b721cafd647d1a5a6b749a6f990f /testhal/STM32/STM32L4xx
parenta7df9a891067621e8e1a5c2a2c0ceada82403afe (diff)
downloadChibiOS-6d8322126585801381cf3974753c40aacc89d845.tar.gz
ChibiOS-6d8322126585801381cf3974753c40aacc89d845.tar.bz2
ChibiOS-6d8322126585801381cf3974753c40aacc89d845.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9496 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32L4xx')
-rw-r--r--testhal/STM32/STM32L4xx/QSPI-N25Q128/Makefile2
-rw-r--r--testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c19
2 files changed, 16 insertions, 5 deletions
diff --git a/testhal/STM32/STM32L4xx/QSPI-N25Q128/Makefile b/testhal/STM32/STM32L4xx/QSPI-N25Q128/Makefile
index 13da447eb..110783df6 100644
--- a/testhal/STM32/STM32L4xx/QSPI-N25Q128/Makefile
+++ b/testhal/STM32/STM32L4xx/QSPI-N25Q128/Makefile
@@ -5,7 +5,7 @@
# Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
diff --git a/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c b/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c
index 942629734..5e57497fa 100644
--- a/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c
+++ b/testhal/STM32/STM32L4xx/QSPI-N25Q128/main.c
@@ -17,7 +17,9 @@
#include "ch.h"
#include "hal.h"
-QSPIConfig qspicfg1 = {
+#include "m25q.h"
+
+const QSPIConfig qspicfg1 = {
NULL,
0
};
@@ -34,6 +36,13 @@ qspi_command_t cmd_read_id = {
uint8_t buffer[512];
+M25QDriver m25q;
+
+const M25QConfig m25qcfg1 = {
+ &QSPID1,
+ &qspicfg1
+};
+
/*
* LED blinker thread, times are in milliseconds.
*/
@@ -76,10 +85,12 @@ int main(void) {
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO + 1, Thread1, NULL);
/*
- * Starting QSPI driver 1.
+ * Initializing and starting M25Q driver.
*/
- qspiStart(&QSPID1, &qspicfg1);
- qspiReceive(&QSPID1, &cmd_read_id, 17, buffer);
+ m25qObjectInit(&m25q);
+ m25qStart(&m25q, &m25qcfg1);
+// qspiStart(&QSPID1, &qspicfg1);
+// qspiReceive(&QSPID1, &cmd_read_id, 17, buffer);
/*
* Normal main() thread activity, in this demo it does nothing.