delete px4_includes.h header and update boards/ to use syslog

This commit is contained in:
Daniel Agar
2019-01-23 18:25:18 -05:00
parent 376e078c24
commit 2ffb49b734
86 changed files with 190 additions and 563 deletions
+9 -27
View File
@@ -79,24 +79,6 @@
* Pre-Processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) syslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
# define message syslog
# else
# define message printf
# endif
#endif
/*
* Ideally we'd be able to get these from up_internal.h,
* but since we want to be able to disable the NuttX use
@@ -137,7 +119,7 @@ __EXPORT void board_peripheral_reset(int ms)
/* wait for the peripheral rail to reach GND */
usleep(ms * 1000);
warnx("reset done, %d ms", ms);
syslog(LOG_DEBUG, "reset done, %d ms\n", ms);
/* re-enable power */
@@ -307,7 +289,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
/* configure the DMA allocator */
if (board_dma_alloc_init() < 0) {
message("DMA alloc FAILED");
syslog(LOG_ERR, "DMA alloc FAILED\n");
}
/* set up the serial DMA polling */
@@ -342,7 +324,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi1 = stm32_spibus_initialize(PX4_SPI_BUS_SENSORS);
if (!spi1) {
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_SENSORS);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_SENSORS);
led_on(LED_RED);
return -ENODEV;
}
@@ -363,7 +345,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi2 = stm32_spibus_initialize(PX4_SPI_BUS_RAMTRON);
if (!spi2) {
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_RAMTRON);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_RAMTRON);
led_on(LED_RED);
return -ENODEV;
}
@@ -382,7 +364,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi5 = stm32_spibus_initialize(PX4_SPI_BUS_EXT0);
if (!spi5) {
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_EXT0);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_EXT0);
led_on(LED_RED);
return -ENODEV;
}
@@ -398,7 +380,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi6 = stm32_spibus_initialize(PX4_SPI_BUS_EXT1);
if (!spi6) {
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_EXT1);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_EXT1);
led_on(LED_RED);
return -ENODEV;
}
@@ -416,8 +398,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (!sdio) {
led_on(LED_RED);
message("[boot] Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO);
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
@@ -426,7 +408,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (ret != OK) {
led_on(LED_RED);
message("[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
return ret;
}
+1 -2
View File
@@ -55,7 +55,6 @@
#include <chip.h>
#include <stm32.h>
#include "board_config.h"
#include <systemlib/err.h>
/************************************************************************************
* Public Functions
@@ -258,7 +257,7 @@ __EXPORT void board_spi_reset(int ms)
/* wait for the sensor rail to reach GND */
usleep(ms * 1000);
warnx("reset done, %d ms", ms);
syslog(LOG_DEBUG, "reset done, %d ms\n", ms);
/* re-enable power */