Skip to content

Commit 4bcefbb

Browse files
author
Andrew Boie
committed
Revert "misc: Remove generic PRINT macros from spi samples"
This reverts commit ea3a836. Change-Id: I7ad5d5c77244b3cec3eaed45a0348610bae15dec Signed-off-by: Andrew Boie <[email protected]>
1 parent 7bc48f6 commit 4bcefbb

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

samples/drivers/spi_test/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
CONFIG_SPI=y
2-
CONFIG_SYS_LOG=y

samples/drivers/spi_test/src/spi.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
#define PRINT printk
2727
#endif
2828

29-
#define SYS_LOG_LEVEL SYS_LOG_LEVEL_INFO
30-
#include <misc/sys_log.h>
31-
3229
#include <string.h>
3330
#include <spi.h>
3431
#define SPI_DRV_NAME "SPI_0"
@@ -66,37 +63,36 @@ struct spi_config spi_conf = {
6663

6764
static void _spi_show(struct spi_config *spi_conf)
6865
{
69-
SYS_LOG_INF("SPI Configuration:");
70-
SYS_LOG_INF("\tbits per word: %u",
71-
SPI_WORD_SIZE_GET(spi_conf->config));
72-
SYS_LOG_INF("\tMode: %u", SPI_MODE(spi_conf->config));
73-
SYS_LOG_INF("\tMax speed Hz: 0x%X", spi_conf->max_sys_freq);
66+
PRINT("SPI Configuration:\n");
67+
PRINT("\tbits per word: %u\n", SPI_WORD_SIZE_GET(spi_conf->config));
68+
PRINT("\tMode: %u\n", SPI_MODE(spi_conf->config));
69+
PRINT("\tMax speed Hz: 0x%X\n", spi_conf->max_sys_freq);
7470
}
7571

7672
void main(void)
7773
{
7874
struct device *spi;
7975

80-
SYS_LOG_INF("==== SPI Test Application ====");
76+
PRINT("==== SPI Test Application ====\n");
8177

8278
spi = device_get_binding(SPI_DRV_NAME);
8379

84-
SYS_LOG_INF("Running...");
80+
PRINT("Running...\n");
8581

8682
spi_configure(spi, &spi_conf);
8783
spi_slave_select(spi, SPI_SLAVE);
8884

8985
_spi_show(&spi_conf);
9086

91-
SYS_LOG_INF("Writing...");
87+
PRINT("Writing...\n");
9288
spi_write(spi, (uint8_t *) wbuf, 6);
9389

94-
SYS_LOG_INF("SPI sent: %s", wbuf);
90+
PRINT("SPI sent: %s\n", wbuf);
9591
print_buf_hex(rbuf, 6);
9692

9793
strcpy(wbuf, "So what then?");
9894
spi_transceive(spi, wbuf, 14, rbuf, 16);
9995

100-
SYS_LOG_INF("SPI transceived: %s", rbuf);
96+
PRINT("SPI transceived: %s\n", rbuf);
10197
print_buf_hex(rbuf, 6);
10298
}

0 commit comments

Comments
 (0)