Skip to content

Commit c41d8af

Browse files
committed
[SPI] Able to build without HAL module
As SPI is a built-in library no need to modify it. Note: no size change Signed-off-by: Frederic Pillon <[email protected]>
1 parent 07dcdc4 commit c41d8af

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Diff for: cores/arduino/stm32/spi_com.c

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#ifdef __cplusplus
4545
extern "C" {
4646
#endif
47+
#if defined(HAL_SPI_MODULE_ENABLED)
4748

4849
/* Private Functions */
4950
/**
@@ -402,6 +403,7 @@ spi_status_e spi_transfer(spi_t *obj, uint8_t *tx_buffer,
402403

403404
return ret;
404405
}
406+
#endif /* HAL_SPI_MODULE_ENABLED */
405407

406408
#ifdef __cplusplus
407409
}

Diff for: cores/arduino/stm32/spi_com.h

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#ifdef __cplusplus
4747
extern "C" {
4848
#endif
49+
#if defined(HAL_SPI_MODULE_ENABLED)
4950

5051
/* Exported types ------------------------------------------------------------*/
5152

@@ -101,6 +102,7 @@ spi_status_e spi_send(spi_t *obj, uint8_t *Data, uint16_t len, uint32_t Timeout)
101102
spi_status_e spi_transfer(spi_t *obj, uint8_t *tx_buffer,
102103
uint8_t *rx_buffer, uint16_t len, uint32_t Timeout);
103104
uint32_t spi_getClkFreq(spi_t *obj);
105+
#endif /* HAL_SPI_MODULE_ENABLED */
104106

105107
#ifdef __cplusplus
106108
}

Diff for: cores/arduino/stm32/stm32yyxx_hal_conf.h

+5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
#endif
3030

3131
#define HAL_RTC_MODULE_ENABLED
32+
33+
#if !defined(HAL_SPI_MODULE_DISABLED)
3234
#define HAL_SPI_MODULE_ENABLED
35+
#else
36+
#undef HAL_SPI_MODULE_ENABLED
37+
#endif
3338

3439
/*
3540
* Not defined by default

0 commit comments

Comments
 (0)