tests: remove redundant PRINT definition
Change-Id: I0ac5b3730a9a84b89f392c58e3b65e47cbdf132b Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
0f227848b9
commit
315862f59a
3 changed files with 19 additions and 39 deletions
|
@ -16,17 +16,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include <zephyr.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <pci/pci.h>
|
||||
|
||||
#if defined(CONFIG_STDOUT_CONSOLE)
|
||||
#include <stdio.h>
|
||||
#define PRINT printf
|
||||
#else
|
||||
#include <misc/printk.h>
|
||||
#define PRINT printk
|
||||
#endif
|
||||
#include <pci/pci.h>
|
||||
|
||||
void pci_enumerate(void)
|
||||
{
|
||||
|
@ -59,7 +51,7 @@ void task_enum_pci(void)
|
|||
}
|
||||
|
||||
pci_enumerate();
|
||||
PRINT("Enumeration complete on %s", CONFIG_ARCH);
|
||||
printk("Enumeration complete on %s", CONFIG_ARCH);
|
||||
done = 1;
|
||||
}
|
||||
|
||||
|
@ -68,7 +60,7 @@ void task_enum_pci(void)
|
|||
void main(void)
|
||||
{
|
||||
pci_enumerate();
|
||||
PRINT("Enumeration complete on %s", CONFIG_ARCH);
|
||||
printk("Enumeration complete on %s", CONFIG_ARCH);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MICROKERNEL */
|
||||
|
|
|
@ -15,14 +15,7 @@
|
|||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
#if defined(CONFIG_STDOUT_CONSOLE)
|
||||
#include <stdio.h>
|
||||
#define PRINT printf
|
||||
#else
|
||||
#include <misc/printk.h>
|
||||
#define PRINT printk
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -34,6 +27,6 @@
|
|||
|
||||
void main(void)
|
||||
{
|
||||
PRINT("Hello World!\n");
|
||||
printk("Hello World!\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -17,17 +17,12 @@
|
|||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
#if defined(CONFIG_STDOUT_CONSOLE)
|
||||
#include <stdio.h>
|
||||
#define PRINT printf
|
||||
#else
|
||||
#include <misc/printk.h>
|
||||
#define PRINT printk
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <spi.h>
|
||||
#include <misc/printk.h>
|
||||
|
||||
|
||||
|
||||
#define SPI_DRV_NAME "SPI_0"
|
||||
|
||||
#ifdef CONFIG_SPI_INTEL
|
||||
|
@ -50,10 +45,10 @@ unsigned char rbuf[16] = {};
|
|||
static void print_buf_hex(unsigned char *b, uint32_t len)
|
||||
{
|
||||
for (; len > 0; len--) {
|
||||
PRINT("0x%x ", *(b++));
|
||||
printk("0x%x ", *(b++));
|
||||
}
|
||||
|
||||
PRINT("\n");
|
||||
printk("\n");
|
||||
}
|
||||
|
||||
struct spi_config spi_conf = {
|
||||
|
@ -63,36 +58,36 @@ struct spi_config spi_conf = {
|
|||
|
||||
static void _spi_show(struct spi_config *spi_conf)
|
||||
{
|
||||
PRINT("SPI Configuration:\n");
|
||||
PRINT("\tbits per word: %u\n", SPI_WORD_SIZE_GET(spi_conf->config));
|
||||
PRINT("\tMode: %u\n", SPI_MODE(spi_conf->config));
|
||||
PRINT("\tMax speed Hz: 0x%X\n", spi_conf->max_sys_freq);
|
||||
printk("SPI Configuration:\n");
|
||||
printk("\tbits per word: %u\n", SPI_WORD_SIZE_GET(spi_conf->config));
|
||||
printk("\tMode: %u\n", SPI_MODE(spi_conf->config));
|
||||
printk("\tMax speed Hz: 0x%X\n", spi_conf->max_sys_freq);
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
struct device *spi;
|
||||
|
||||
PRINT("==== SPI Test Application ====\n");
|
||||
printk("==== SPI Test Application ====\n");
|
||||
|
||||
spi = device_get_binding(SPI_DRV_NAME);
|
||||
|
||||
PRINT("Running...\n");
|
||||
printk("Running...\n");
|
||||
|
||||
spi_configure(spi, &spi_conf);
|
||||
spi_slave_select(spi, SPI_SLAVE);
|
||||
|
||||
_spi_show(&spi_conf);
|
||||
|
||||
PRINT("Writing...\n");
|
||||
printk("Writing...\n");
|
||||
spi_write(spi, (uint8_t *) wbuf, 6);
|
||||
|
||||
PRINT("SPI sent: %s\n", wbuf);
|
||||
printk("SPI sent: %s\n", wbuf);
|
||||
print_buf_hex(rbuf, 6);
|
||||
|
||||
strcpy(wbuf, "So what then?");
|
||||
spi_transceive(spi, wbuf, 14, rbuf, 16);
|
||||
|
||||
PRINT("SPI transceived: %s\n", rbuf);
|
||||
printk("SPI transceived: %s\n", rbuf);
|
||||
print_buf_hex(rbuf, 6);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue