Skip to content

Commit 16d7b2b

Browse files
committed
[SPI] Allow to enable HAL module only
Allow HAL SPI module usage without any usage by the core. Fixes stm32duino#697 Signed-off-by: Frederic Pillon <[email protected]>
1 parent fe3fca1 commit 16d7b2b

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

cores/arduino/board.h

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "hw_config.h"
1515
#include "low_power.h"
1616
#include "rtc.h"
17-
#include "spi_com.h"
1817
#include "stm32_eeprom.h"
1918
#include "timer.h"
2019
#include "uart.h"

libraries/SPI/src/SPI.h

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
#include "Arduino.h"
1616
#include <stdio.h>
17+
extern "C" {
18+
#include "utility/spi_com.h"
19+
}
1720

1821
// SPI_HAS_TRANSACTION means SPI has
1922
// - beginTransaction()

libraries/SPI/src/utility/spi_com.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@
3737
*/
3838
#include "core_debug.h"
3939
#include "stm32_def.h"
40-
#include "spi_com.h"
40+
#include "utility/spi_com.h"
4141
#include "PinAF_STM32F1.h"
4242
#include "pinconfig.h"
4343

4444
#ifdef __cplusplus
4545
extern "C" {
4646
#endif
47-
#if defined(HAL_SPI_MODULE_ENABLED)
4847

4948
/* Private Functions */
5049
/**
@@ -430,7 +429,6 @@ spi_status_e spi_transfer(spi_t *obj, uint8_t *tx_buffer,
430429

431430
return ret;
432431
}
433-
#endif /* HAL_SPI_MODULE_ENABLED */
434432

435433
#ifdef __cplusplus
436434
}

libraries/SPI/src/utility/spi_com.h

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

5150
/* Exported types ------------------------------------------------------------*/
5251

@@ -102,7 +101,6 @@ spi_status_e spi_send(spi_t *obj, uint8_t *Data, uint16_t len, uint32_t Timeout)
102101
spi_status_e spi_transfer(spi_t *obj, uint8_t *tx_buffer,
103102
uint8_t *rx_buffer, uint16_t len, uint32_t Timeout);
104103
uint32_t spi_getClkFreq(spi_t *obj);
105-
#endif /* HAL_SPI_MODULE_ENABLED */
106104

107105
#ifdef __cplusplus
108106
}

0 commit comments

Comments
 (0)