mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 17:43:35 +08:00
delete px4_includes.h header and update boards/ to use syslog
This commit is contained in:
@@ -78,24 +78,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
|
||||
@@ -160,7 +142,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 */
|
||||
|
||||
@@ -257,7 +239,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 */
|
||||
@@ -290,7 +272,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
spi1 = px4_spibus_initialize(1);
|
||||
|
||||
if (!spi1) {
|
||||
message("[boot] FAILED to initialize SPI port 1\n");
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n");
|
||||
led_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -309,7 +291,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
spi2 = px4_spibus_initialize(2);
|
||||
|
||||
if (!spi2) {
|
||||
message("[boot] FAILED to initialize SPI port 2\n");
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 2\n");
|
||||
led_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -330,8 +312,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
|
||||
|
||||
if (!sdio) {
|
||||
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);
|
||||
led_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -340,7 +322,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
|
||||
|
||||
if (ret != OK) {
|
||||
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);
|
||||
led_on(LED_AMBER);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
#include <chip.h>
|
||||
#include <stm32.h>
|
||||
#include "board_config.h"
|
||||
#include <systemlib/err.h>
|
||||
|
||||
|
||||
/************************************************************************************
|
||||
@@ -176,7 +175,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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user