Skip to content

Commit 5038b38

Browse files
0xc0170maciejbocianski
authored andcommitted
QSPI STM32: fix pin merging
hw name as input
1 parent 16ca742 commit 5038b38

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

targets/TARGET_STM/qspi_api.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,16 @@ qspi_status_t qspi_init(qspi_t *obj, PinName io0, PinName io1, PinName io2, PinN
137137

138138
obj->handle.Init.ClockMode = mode == 0 ? QSPI_CLOCK_MODE_0 : QSPI_CLOCK_MODE_3;
139139

140-
QSPIName qspi_data_first = (SPIName)pinmap_merge(io0, io1);
141-
QSPIName qspi_data_second = (SPIName)pinmap_merge(io1, io2);
142-
QSPIName qspi_data_third = (SPIName)pinmap_merge(io2, io3);
140+
QSPIName qspiio0name = (QSPIName)pinmap_peripheral(io0, PinMap_QSPI_DATA);
141+
QSPIName qspiio1name = (QSPIName)pinmap_peripheral(io1, PinMap_QSPI_DATA);
142+
QSPIName qspiio2name = (QSPIName)pinmap_peripheral(io2, PinMap_QSPI_DATA);
143+
QSPIName qspiio3name = (QSPIName)pinmap_peripheral(io3, PinMap_QSPI_DATA);
144+
QSPIName qspiclkname = (QSPIName)pinmap_peripheral(sclk, PinMap_QSPI_SCLK);
145+
QSPIName qspisselname = (QSPIName)pinmap_peripheral(ssel, PinMap_QSPI_SSEL);
146+
147+
QSPIName qspi_data_first = (QSPIName)pinmap_merge(qspiio0name, qspiio1name);
148+
QSPIName qspi_data_second = (QSPIName)pinmap_merge(qspiio2name, qspiio3name);
149+
QSPIName qspi_data_third = (QSPIName)pinmap_merge(qspiclkname, qspisselname);
143150

144151
if (qspi_data_first != qspi_data_second || qspi_data_second != qspi_data_third ||
145152
qspi_data_first != qspi_data_third) {

0 commit comments

Comments
 (0)