Skip to content

Commit 9475558

Browse files
Donatien Garniermprse
authored andcommitted
Add missing ifdef guards in spi_api.c files
1 parent 47b3535 commit 9475558

File tree

37 files changed

+170
-3
lines changed

37 files changed

+170
-3
lines changed

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include <math.h>
1720

1821
#include "spi_api.h"
@@ -331,3 +334,5 @@ int spi_busy(spi_t *obj)
331334
{
332335
return ssp_busy(obj);
333336
}
337+
338+
#endif

targets/TARGET_ARM_SSG/TARGET_BEETLE/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include <math.h>
1720

1821
#include "spi_api.h"
@@ -284,3 +287,5 @@ uint8_t spi_get_module(spi_t *obj) {
284287
int spi_busy(spi_t *obj) {
285288
return 0;
286289
}
290+
291+
#endif

targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/spi_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#if DEVICE_SPI
18+
1719
#include "spi_api.h"
1820
#include "pinmap.h"
1921
#include "mbed_error.h"
@@ -263,3 +265,5 @@ int spi_busy(spi_t *obj)
263265
int32_t status = spi_pl022_get_status(obj->spi);
264266
return (status & SPI_PL022_SSPSR_BSY_MSK);
265267
}
268+
269+
#endif

targets/TARGET_ARM_SSG/TARGET_IOTSS/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include <math.h>
1720

1821
#include "spi_api.h"
@@ -299,3 +302,5 @@ void spi_slave_write(spi_t *obj, int value) {
299302
int spi_busy(spi_t *obj) {
300303
return ssp_busy(obj);
301304
}
305+
306+
#endif

targets/TARGET_ARM_SSG/TARGET_MPS2/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include <math.h>
1720

1821
#include "spi_api.h"
@@ -299,3 +302,5 @@ void spi_slave_write(spi_t *obj, int value) {
299302
int spi_busy(spi_t *obj) {
300303
return ssp_busy(obj);
301304
}
305+
306+
#endif

targets/TARGET_Atmel/TARGET_SAM_CortexM0P/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include "mbed_assert.h"
1720
#include "spi_api.h"
1821

@@ -1014,3 +1017,5 @@ void spi_abort_asynch(spi_t *obj)
10141017
}
10151018

10161019
#endif /* DEVICE_SPI_ASYNCH */
1020+
1021+
#endif

targets/TARGET_Atmel/TARGET_SAM_CortexM4/spi_api.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#if DEVICE_SPI
18+
1719
#include "device.h"
1820
#include "dma_api.h"
1921
#include "buffer.h"
@@ -518,4 +520,6 @@ void spi_abort_asynch(spi_t *obj)
518520
NVIC_DisableIRQ(obj->spi.irq_type);
519521
}
520522

521-
#endif
523+
#endif
524+
525+
#endif

targets/TARGET_Cypress/TARGET_PSOC6/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
* limitations under the License.
1616
*/
1717

18+
#if DEVICE_SPI
19+
1820
#include "cmsis.h"
1921
#include "mbed_assert.h"
2022
#include "mbed_error.h"
2123
#include "mbed_debug.h"
2224
#include "PeripheralPins.h"
2325
#include "pinmap.h"
2426
#include "spi_api.h"
27+
2528
#include "psoc6_utils.h"
2629

2730
#include "drivers/peripheral/sysclk/cy_sysclk.h"
@@ -564,3 +567,5 @@ void spi_abort_asynch(spi_t *obj_in)
564567
}
565568

566569
#endif // DEVICE_ASYNCH
570+
571+
#endif

targets/TARGET_Freescale/TARGET_K20XX/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include "mbed_assert.h"
1720
#include "spi_api.h"
1821

@@ -167,3 +170,5 @@ int spi_slave_read(spi_t *obj) {
167170
void spi_slave_write(spi_t *obj, int value) {
168171
while (!spi_writeable(obj));
169172
}
173+
174+
#endif

targets/TARGET_Freescale/TARGET_KLXX/TARGET_KL05Z/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include "spi_api.h"
1720

1821
#include <math.h>
@@ -168,3 +171,5 @@ void spi_slave_write(spi_t *obj, int value) {
168171
while (!spi_writeable(obj));
169172
obj->spi->D = value;
170173
}
174+
175+
#endif

targets/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include "spi_api.h"
1720

1821
#include <math.h>
@@ -147,3 +150,5 @@ void spi_slave_write(spi_t *obj, int value) {
147150
while (!spi_writeable(obj));
148151
obj->spi->D = value;
149152
}
153+
154+
#endif

targets/TARGET_Freescale/TARGET_KLXX/TARGET_KL26Z/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include "mbed_assert.h"
1720
#include "spi_api.h"
1821

@@ -239,3 +242,5 @@ void spi_slave_write(spi_t *obj, int value) {
239242
}
240243

241244
}
245+
246+
#endif

targets/TARGET_Freescale/TARGET_KLXX/TARGET_KL46Z/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include "mbed_assert.h"
1720
#include "spi_api.h"
1821

@@ -239,3 +242,5 @@ void spi_slave_write(spi_t *obj, int value) {
239242
}
240243

241244
}
245+
246+
#endif

targets/TARGET_Maxim/TARGET_MAX32600/spi_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*******************************************************************************
3232
*/
3333

34+
#if DEVICE_SPI
35+
3436
#include <string.h>
3537
#include "mbed_assert.h"
3638
#include "cmsis.h"
@@ -199,3 +201,5 @@ int spi_busy(spi_t *obj)
199201
{
200202
return !(obj->spi->intfl & MXC_F_SPI_INTFL_TX_READY);
201203
}
204+
205+
#endif

targets/TARGET_Maxim/TARGET_MAX32610/spi_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*******************************************************************************
3232
*/
3333

34+
#if DEVICE_SPI
35+
3436
#include <string.h>
3537
#include "mbed_assert.h"
3638
#include "cmsis.h"
@@ -199,3 +201,5 @@ int spi_busy(spi_t *obj)
199201
{
200202
return !(obj->spi->intfl & MXC_F_SPI_INTFL_TX_READY);
201203
}
204+
205+
#endif

targets/TARGET_Maxim/TARGET_MAX32620/spi_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*******************************************************************************
3232
*/
3333

34+
#if DEVICE_SPI
35+
3436
#include <string.h>
3537
#include "mbed_assert.h"
3638
#include "cmsis.h"
@@ -573,3 +575,5 @@ void SPI1_IRQHandler(void) { SPI_IRQHandler(1); }
573575
void SPI2_IRQHandler(void) { SPI_IRQHandler(2); }
574576

575577
#endif
578+
579+
#endif

targets/TARGET_Maxim/TARGET_MAX32620C/spi_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*******************************************************************************
3232
*/
3333

34+
#if DEVICE_SPI
35+
3436
#include "mbed_assert.h"
3537
#include "mbed_critical.h"
3638
#include "spi_api.h" // mbed HAL
@@ -233,3 +235,5 @@ uint8_t spi_get_module(spi_t *obj)
233235
{
234236
return obj->index;
235237
}
238+
239+
#endif

targets/TARGET_Maxim/TARGET_MAX32625/spi_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*******************************************************************************
3232
*/
3333

34+
#if DEVICE_SPI
35+
3436
#include "mbed_assert.h"
3537
#include "mbed_critical.h"
3638
#include "spi_api.h" // mbed HAL
@@ -233,3 +235,5 @@ uint8_t spi_get_module(spi_t *obj)
233235
{
234236
return obj->index;
235237
}
238+
239+
#endif

targets/TARGET_Maxim/TARGET_MAX32630/spi_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*******************************************************************************
3232
*/
3333

34+
#if DEVICE_SPI
35+
3436
#include "mbed_assert.h"
3537
#include "mbed_critical.h"
3638
#include "spi_api.h" // mbed HAL
@@ -233,3 +235,5 @@ uint8_t spi_get_module(spi_t *obj)
233235
{
234236
return obj->index;
235237
}
238+
239+
#endif

targets/TARGET_NORDIC/TARGET_MCU_NRF51822/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
//#include <math.h>
1720
#include "mbed_assert.h"
1821
#include "spi_api.h"
@@ -299,3 +302,5 @@ void spi_slave_write(spi_t *obj, int value)
299302
obj->spis->EVENTS_ACQUIRED = 0;
300303
obj->spis->EVENTS_END = 0;
301304
}
305+
306+
#endif

targets/TARGET_NXP/TARGET_LPC11UXX/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include "mbed_assert.h"
1720
#include <math.h>
1821
#include "spi_api.h"
@@ -187,3 +190,5 @@ void spi_slave_write(spi_t *obj, int value) {
187190
int spi_busy(spi_t *obj) {
188191
return ssp_busy(obj);
189192
}
193+
194+
#endif

targets/TARGET_NXP/TARGET_LPC11XX_11CXX/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include "mbed_assert.h"
1720
#include <math.h>
1821
#include "spi_api.h"
@@ -223,3 +226,5 @@ void spi_slave_write(spi_t *obj, int value) {
223226
int spi_busy(spi_t *obj) {
224227
return ssp_busy(obj);
225228
}
229+
230+
#endif

targets/TARGET_NXP/TARGET_LPC13XX/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include "mbed_assert.h"
1720
#include <math.h>
1821
#include "spi_api.h"
@@ -215,3 +218,5 @@ void spi_slave_write(spi_t *obj, int value) {
215218
int spi_busy(spi_t *obj) {
216219
return ssp_busy(obj);
217220
}
221+
222+
#endif

targets/TARGET_NXP/TARGET_LPC15XX/spi_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#if DEVICE_SPI
18+
1619
#include "mbed_assert.h"
1720
#include <math.h>
1821

@@ -278,3 +281,5 @@ void spi_slave_write(spi_t *obj, int value)
278281
while (spi_writeable(obj) == 0) ;
279282
obj->spi->TXDAT = value;
280283
}
284+
285+
#endif

0 commit comments

Comments
 (0)