Skip to content

Commit aaf5977

Browse files
RSATomdexter93
authored andcommitted
sn32: spi: reduced amount of memory used on stack
1 parent 20df1af commit aaf5977

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

os/hal/ports/SN32/LLD/SN32F2xx/SPI/hal_spi_v2_lld.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ SPIDriver SPID1;
5858

5959
static void spi_lld_configure(SPIDriver *spip) {
6060
spip->spi->CTRL0 = spip->config->ctrl0;
61-
spip->spi->CTRL1 = spip->config->ctrl1;
62-
spip->spi->CLKDIV = spip->config->clkdiv;
61+
spip->spi->CTRL1 = (uint32_t)spip->config->ctrl1;
62+
spip->spi->CLKDIV = (uint32_t)spip->config->clkdiv;
6363

6464
spip->spi->CTRL0 |= (spip->config->slave << 3);
6565
spip->spi->CTRL0_b.SDODIS = false;

os/hal/ports/SN32/LLD/SN32F2xx/SPI/hal_spi_v2_lld.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@
163163
*/
164164
#define spi_lld_config_fields \
165165
uint32_t ctrl0; \
166-
uint32_t ctrl1; \
167-
uint32_t clkdiv;
166+
uint8_t ctrl1; \
167+
uint8_t clkdiv;
168168

169169

170170
/*===========================================================================*/

0 commit comments

Comments
 (0)