Skip to content

Commit 541a2c8

Browse files
committed
Remove DEBUG
1 parent 40831f7 commit 541a2c8

File tree

1 file changed

+5
-4
lines changed
  • targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52

1 file changed

+5
-4
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/spi_api.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#include "nrfx_spi.h"
5151
#endif
5252

53-
#if 1
53+
#if 0
5454
#define DEBUG_PRINTF(...) printf(__VA_ARGS__)
5555
#else
5656
#define DEBUG_PRINTF(...)
@@ -236,7 +236,6 @@ void spi_get_capabilities(PinName ssel, bool slave, spi_capabilities_t *cap)
236236
*/
237237
void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel)
238238
{
239-
DEBUG_PRINTF("spi_api: spi_init - ENTER\r\n");
240239
#if DEVICE_SPI_ASYNCH
241240
struct spi_s *spi_inst = &obj->spi;
242241
#else
@@ -245,8 +244,11 @@ void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel
245244

246245
/* Get instance based on requested pins. */
247246
spi_inst->instance = pin_instance_spi(mosi, miso, sclk);
247+
#if NRFX_CHECK(NRFX_SPIM_ENABLED)
248248
MBED_ASSERT(spi_inst->instance < NRFX_SPIM_ENABLED_COUNT);
249-
DEBUG_PRINTF("spi_api: spi_init - spi_inst->instance=%d\r\n", spi_inst->instance);
249+
#elif NRFX_CHECK(NRFX_SPI_ENABLED)
250+
MBED_ASSERT(spi_inst->instance < NRFX_SPI_ENABLED_COUNT);
251+
#endif
250252

251253
/* Store chip select separately for manual enabling. */
252254
spi_inst->cs = ssel;
@@ -305,7 +307,6 @@ void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel
305307
NVIC_SetVector(SPIM3_IRQn, (uint32_t) SPIM3_IRQHandler);
306308
#endif
307309
}
308-
DEBUG_PRINTF("spi_api: spi_init - EXIT\r\n");
309310
}
310311

311312
/** Release a SPI object

0 commit comments

Comments
 (0)