mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err()
This commit is contained in:
@@ -235,7 +235,7 @@ int board_tsc_setup(int minor)
|
||||
FAR struct spi_dev_s *dev;
|
||||
int ret;
|
||||
|
||||
idbg("minor %d\n", minor);
|
||||
ierr("minor %d\n", minor);
|
||||
DEBUGASSERT(minor == 0);
|
||||
|
||||
/* Configure and enable the ADS7843E interrupt pin as an input */
|
||||
@@ -252,7 +252,7 @@ int board_tsc_setup(int minor)
|
||||
dev = sam_spibus_initialize(TSC_CSNUM);
|
||||
if (!dev)
|
||||
{
|
||||
idbg("Failed to initialize SPI chip select %d\n", TSC_CSNUM);
|
||||
ierr("Failed to initialize SPI chip select %d\n", TSC_CSNUM);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ int board_tsc_setup(int minor)
|
||||
ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
idbg("Failed to initialize SPI chip select %d\n", TSC_CSNUM);
|
||||
ierr("Failed to initialize SPI chip select %d\n", TSC_CSNUM);
|
||||
/* sam_spibus_uninitialize(dev); */
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ int sam_at25_automount(int minor)
|
||||
spi = sam_spibus_initialize(FLASH_CSNUM);
|
||||
if (!spi)
|
||||
{
|
||||
fdbg("ERROR: Failed to initialize SPI port %d\n", FLASH_CSNUM);
|
||||
ferr("ERROR: Failed to initialize SPI port %d\n", FLASH_CSNUM);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ int sam_at25_automount(int minor)
|
||||
mtd = at25_initialize(spi);
|
||||
if (!mtd)
|
||||
{
|
||||
fdbg("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n");
|
||||
ferr("ERROR: Failed to bind SPI port %d to the AT25 FLASH driver\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ int sam_at25_automount(int minor)
|
||||
ret = ftl_initialize(minor, mtd);
|
||||
if (ret < 0)
|
||||
{
|
||||
fdbg("ERROR: Failed to initialize the FTL layer: %d\n", ret);
|
||||
ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ int sam_at25_automount(int minor)
|
||||
ret = nxffs_initialize(mtd);
|
||||
if (ret < 0)
|
||||
{
|
||||
fdbg("ERROR: NXFFS initialization failed: %d\n", ret);
|
||||
ferr("ERROR: NXFFS initialization failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ int sam_at25_automount(int minor)
|
||||
ret = mount(NULL, "/mnt/at25", "nxffs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno);
|
||||
ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -74,10 +74,10 @@
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NETDEV_PHY_DEBUG
|
||||
# define phydbg dbg
|
||||
# define phyerr err
|
||||
# define phyllerr llerr
|
||||
#else
|
||||
# define phydbg(x...)
|
||||
# define phyerr(x...)
|
||||
# define phyllerr(x...)
|
||||
#endif
|
||||
|
||||
@@ -100,7 +100,7 @@ static xcpt_t g_emac_handler;
|
||||
#ifdef CONFIG_SAM34_GPIOD_IRQ
|
||||
static void sam_emac_phy_enable(bool enable)
|
||||
{
|
||||
phydbg("IRQ%d: enable=%d\n", SAM_PHY_IRQ, enable);
|
||||
phyerr("IRQ%d: enable=%d\n", SAM_PHY_IRQ, enable);
|
||||
if (enable)
|
||||
{
|
||||
sam_gpioirqenable(SAM_PHY_IRQ);
|
||||
@@ -126,7 +126,7 @@ static void sam_emac_phy_enable(bool enable)
|
||||
|
||||
void weak_function sam_netinitialize(void)
|
||||
{
|
||||
phydbg("Configuring %08x\n", GPIO_PHY_IRQ);
|
||||
phyerr("Configuring %08x\n", GPIO_PHY_IRQ);
|
||||
sam_configgpio(GPIO_PHY_IRQ);
|
||||
}
|
||||
|
||||
@@ -206,11 +206,11 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable)
|
||||
DEBUGASSERT(intf);
|
||||
|
||||
ninfo("%s: handler=%p\n", intf, handler);
|
||||
phydbg("EMAC: devname=%s\n", SAM34_EMAC_DEVNAME);
|
||||
phyerr("EMAC: devname=%s\n", SAM34_EMAC_DEVNAME);
|
||||
|
||||
if (strcmp(intf, SAM34_EMAC_DEVNAME) == 0)
|
||||
{
|
||||
phydbg("Select EMAC\n");
|
||||
phyerr("Select EMAC\n");
|
||||
phandler = &g_emac_handler;
|
||||
pinset = GPIO_PHY_IRQ;
|
||||
irq = SAM_PHY_IRQ;
|
||||
@@ -218,7 +218,7 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable)
|
||||
}
|
||||
else
|
||||
{
|
||||
ndbg("Unsupported interface: %s\n", intf);
|
||||
nerr("Unsupported interface: %s\n", intf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -237,15 +237,15 @@ xcpt_t arch_phy_irq(FAR const char *intf, xcpt_t handler, phy_enable_t *enable)
|
||||
|
||||
if (handler)
|
||||
{
|
||||
phydbg("Configure pin: %08x\n", pinset);
|
||||
phyerr("Configure pin: %08x\n", pinset);
|
||||
sam_gpioirq(pinset);
|
||||
|
||||
phydbg("Attach IRQ%d\n", irq);
|
||||
phyerr("Attach IRQ%d\n", irq);
|
||||
(void)irq_attach(irq, handler);
|
||||
}
|
||||
else
|
||||
{
|
||||
phydbg("Detach IRQ%d\n", irq);
|
||||
phyerr("Detach IRQ%d\n", irq);
|
||||
(void)irq_detach(irq);
|
||||
enabler = NULL;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ int sam_hsmci_initialize(int minor)
|
||||
g_hsmci.hsmci = sdio_initialize(0);
|
||||
if (!g_hsmci.hsmci)
|
||||
{
|
||||
fdbg("Failed to initialize SDIO\n");
|
||||
ferr("Failed to initialize SDIO\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ int sam_hsmci_initialize(int minor)
|
||||
ret = mmcsd_slotinitialize(minor, g_hsmci.hsmci);
|
||||
if (ret != OK)
|
||||
{
|
||||
fdbg("Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
|
||||
ferr("Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -269,10 +269,10 @@
|
||||
/* Debug ******************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_LCD
|
||||
# define lcddbg dbg
|
||||
# define lcderr err
|
||||
# define lcdinfo info
|
||||
#else
|
||||
# define lcddbg(x...)
|
||||
# define lcderr(x...)
|
||||
# define lcdinfo(x...)
|
||||
#endif
|
||||
|
||||
@@ -1292,7 +1292,7 @@ static inline int sam_lcd_initialize(void)
|
||||
|
||||
if (id != ILI9325_DEVICE_CODE)
|
||||
{
|
||||
lcddbg("ERROR: Unsupported LCD: %04x\n", id);
|
||||
lcderr("ERROR: Unsupported LCD: %04x\n", id);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
||||
@@ -272,10 +272,10 @@
|
||||
/* Debug ******************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_LCD
|
||||
# define lcddbg dbg
|
||||
# define lcderr err
|
||||
# define lcdinfo info
|
||||
#else
|
||||
# define lcddbg(x...)
|
||||
# define lcderr(x...)
|
||||
# define lcdinfo(x...)
|
||||
#endif
|
||||
|
||||
@@ -1171,7 +1171,7 @@ static inline int sam_lcd_initialize(void)
|
||||
id = ((uint16_t)buffer[2] << 8) | (uint16_t)buffer[3];
|
||||
if (id != ILI9341_DEVICE_CODE)
|
||||
{
|
||||
lcddbg("ERROR: Unsupported LCD: %04x\n", id);
|
||||
lcderr("ERROR: Unsupported LCD: %04x\n", id);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
||||
@@ -103,10 +103,10 @@
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_DEBUG_LEDS
|
||||
# define leddbg llerr
|
||||
# define lederr llerr
|
||||
# define ledinfo llinfo
|
||||
#else
|
||||
# define leddbg(x...)
|
||||
# define lederr(x...)
|
||||
# define ledinfo(x...)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
#undef SPI_VERBOSE /* Define to enable verbose debug */
|
||||
|
||||
#ifdef SPI_DEBUG
|
||||
# define spidbg llerr
|
||||
# define spierr llerr
|
||||
# ifdef SPI_VERBOSE
|
||||
# define spiinfo llerr
|
||||
# else
|
||||
@@ -73,7 +73,7 @@
|
||||
# endif
|
||||
#else
|
||||
# undef SPI_VERBOSE
|
||||
# define spidbg(x...)
|
||||
# define spierr(x...)
|
||||
# define spiinfo(x...)
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user