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

This commit is contained in:
Daniel Agar
2019-01-22 11:23:29 -05:00
parent 376e078c24
commit 2ffb49b734
86 changed files with 190 additions and 563 deletions
+6 -24
View File
@@ -77,24 +77,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
@@ -237,7 +219,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 */
@@ -270,7 +252,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi4 = px4_spibus_initialize(4);
if (!spi4) {
message("[boot] FAILED to initialize SPI port 4\n");
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 4\n");
board_autoled_on(LED_AMBER);
return -ENODEV;
}
@@ -290,7 +272,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi1 = stm32_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");
board_autoled_on(LED_AMBER);
return -ENODEV;
}
@@ -320,8 +302,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);
return -ENODEV;
}
@@ -329,7 +311,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);
return ret;
}
+1 -2
View File
@@ -54,7 +54,6 @@
#include <chip.h>
#include <stm32.h>
#include "board_config.h"
#include <systemlib/err.h>
/************************************************************************************
* Public Functions
@@ -208,7 +207,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 */
//
+5 -23
View File
@@ -80,24 +80,6 @@
* Pre-Processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) syslog(LOG_NOTICE, __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
@@ -239,7 +221,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");
}
@@ -253,7 +235,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi0 = px4_spibus_initialize(PX4_SPI_BUS_SENSORS);
if (!spi0) {
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);
board_autoled_on(LED_AMBER);
return -ENODEV;
}
@@ -285,8 +267,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);
return -ENODEV;
}
@@ -294,7 +276,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);
return ret;
}
+7 -25
View File
@@ -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;
}
+1 -2
View File
@@ -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 */
-1
View File
@@ -57,7 +57,6 @@
#include <chip.h>
#include <stm32_gpio.h>
#include "board_config.h"
#include <systemlib/err.h>
/****************************************************************************
* Pre-Processor Definitions
-18
View File
@@ -73,24 +73,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
+1 -2
View File
@@ -19,7 +19,6 @@
#include <chip.h>
#include <stm32_gpio.h>
#include "board_config.h"
#include <systemlib/err.h>
/****************************************************************************
* Pre-Processor Definitions
@@ -147,7 +146,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);
/* wait a bit before starting SPI, different times didn't influence results */
usleep(100);
@@ -52,6 +52,7 @@
#include <stdio.h>
#include <poll.h>
#include <string.h>
#include <stdlib.h>
#define ADC_BASE_DEV_PATH "/dev/adc"
#define ADC_SYSFS_PATH "/sys/kernel/rcio/adc/ch0"
@@ -34,6 +34,8 @@
#include <px4_posix.h>
#include <drivers/drv_led.h>
#include <string.h>
#include "navio_rgbled.h"
#define RGBLED_BASE_DEVICE_PATH "/dev/rgbled"
@@ -38,6 +38,8 @@
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <px4_config.h>
#include <px4_workqueue.h>
+4 -22
View File
@@ -74,24 +74,6 @@
* Pre-Processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lowsyslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
# define message lowsyslog
# 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
@@ -125,7 +107,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 */
/* switch the peripheral rail back on */
@@ -207,7 +189,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 */
@@ -236,7 +218,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi3 = px4_spibus_initialize(3);
if (!spi3) {
message("[boot] FAILED to initialize SPI port 3\n");
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 3\n");
led_on(LED_AMBER);
return -ENODEV;
}
@@ -255,7 +237,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi4 = px4_spibus_initialize(4);
if (!spi4) {
message("[boot] FAILED to initialize SPI port 4\n");
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 4\n");
led_on(LED_AMBER);
return -ENODEV;
}
+1 -2
View File
@@ -54,7 +54,6 @@
#include <chip.h>
#include <stm32.h>
#include "board_config.h"
#include <systemlib/err.h>
/************************************************************************************
* Public Functions
@@ -203,7 +202,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);
/* wait a bit before starting SPI, different times didn't influence results */
usleep(100);
+1 -19
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
@@ -226,7 +208,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
result = parameter_flashfs_init(params_sector_map, NULL, 0);
if (result != OK) {
message("[boot] FAILED to init params in FLASH %d\n", result);
syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result);
led_on(LED_AMBER);
return -ENODEV;
}
+2 -20
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
@@ -204,7 +186,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 */
@@ -282,7 +264,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 */
+1 -1
View File
@@ -208,7 +208,7 @@ int fmuk66_sdhc_initialize(void)
return ret;
}
syslog(LOG_INFO, "Successfully bound SDHC to the MMC/SD driver\n");
syslog(LOG_ERR, "Successfully bound SDHC to the MMC/SD driver\n");
/* Handle the initial card state */
+4 -20
View File
@@ -51,25 +51,9 @@
#include "chip.h"
#include <kinetis.h>
#include "board_config.h"
#include <systemlib/err.h>
#include <systemlib/px4_macros.h>
#if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || \
defined(CONFIG_KINETIS_SPI2)
#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
#if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2)
/* Define CS GPIO array */
static const uint32_t spi0selects_gpio[] = PX4_MEMORY_BUS_CS_GPIO;
@@ -208,7 +192,7 @@ __EXPORT int fmuk66_spi_bus_initialize(void)
spi_sensors = px4_spibus_initialize(PX4_SPI_BUS_SENSORS);
if (!spi_sensors) {
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);
return -ENODEV;
}
@@ -228,7 +212,7 @@ __EXPORT int fmuk66_spi_bus_initialize(void)
spi_memory = px4_spibus_initialize(PX4_SPI_BUS_MEMORY);
if (!spi_memory) {
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_MEMORY);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_MEMORY);
return -ENODEV;
}
@@ -248,7 +232,7 @@ __EXPORT int fmuk66_spi_bus_initialize(void)
spi_ext = px4_spibus_initialize(PX4_SPI_BUS_EXTERNAL);
if (!spi_ext) {
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_EXTERNAL);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_EXTERNAL);
return -ENODEV;
}
+6 -24
View File
@@ -82,24 +82,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
@@ -262,7 +244,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 */
@@ -297,7 +279,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi1 = stm32_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_BLUE);
return -ENODEV;
}
@@ -314,7 +296,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi2 = stm32_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi2) {
message("[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO);
led_on(LED_BLUE);
return -ENODEV;
}
@@ -324,7 +306,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (result != OK) {
led_on(LED_BLUE);
message("[boot] FAILED to bind SPI port 2 to the MMCSD driver\n");
syslog(LOG_ERR, "[boot] FAILED to bind SPI port 2 to the MMCSD driver\n");
return -ENODEV;
}
@@ -335,7 +317,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi3 = stm32_spibus_initialize(3);
if (!spi3) {
message("[boot] FAILED to initialize SPI port 3\n");
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 3\n");
led_on(LED_BLUE);
return -ENODEV;
}
@@ -362,7 +344,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
result = parameter_flashfs_init(params_sector_map, NULL, 0);
if (result != OK) {
message("[boot] FAILED to init params in FLASH %d\n", result);
syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result);
led_on(LED_AMBER);
return -ENODEV;
}
-1
View File
@@ -55,7 +55,6 @@
#include <chip.h>
#include <stm32.h>
#include "board_config.h"
#include <systemlib/err.h>
/************************************************************************************
* Public Functions
+2
View File
@@ -38,7 +38,9 @@
* an optical flow computation.
*/
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <px4_tasks.h>
#include <px4_getopt.h>
@@ -40,6 +40,8 @@
#include "video_device.h"
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
+1
View File
@@ -3,6 +3,7 @@ px4_add_board(
PLATFORM nuttx
VENDOR px4
MODEL fmu-v2
LABEL default
TOOLCHAIN arm-none-eabi
ARCHITECTURE cortex-m4
ROMFSROOT px4fmu_common
+12 -31
View File
@@ -47,7 +47,6 @@
#include <px4_config.h>
#include <px4_tasks.h>
#include <px4_time.h>
#include <stdbool.h>
#include <stdio.h>
@@ -79,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
@@ -130,8 +111,8 @@ __EXPORT void board_peripheral_reset(int ms)
stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 1);
/* wait for the peripheral rail to reach GND */
px4_usleep(ms * 1000);
warnx("reset done, %d ms", ms);
usleep(ms * 1000);
syslog(LOG_DEBUG, "reset done, %d ms\n", ms);
/* re-enable power */
@@ -382,7 +363,7 @@ static struct sdio_dev_s *sdio;
__EXPORT int board_app_initialize(uintptr_t arg)
{
/* Ensure the power is on 1 ms before we drive the GPIO pins */
px4_usleep(1000);
usleep(1000);
if (OK == determin_hw_version(&hw_version, & hw_revision)) {
switch (hw_version) {
@@ -416,7 +397,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
hw_version = HW_VER_FMUV3_STATE;
hw_type[1]++;
hw_type[2] = '0';
message("\nPixhack V3 detected, forcing to fmu-v3");
syslog(LOG_INFO, "\nPixhack V3 detected, forcing to fmu-v3");
} else {
@@ -431,12 +412,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
/* questionable px4_fmu-v2 hardware, try forcing regular FMUv2 (not much else we can do) */
message("\nbad version detected, forcing to fmu-v2");
syslog(LOG_ERR, "\nbad version detected, forcing to fmu-v2");
hw_version = HW_VER_FMUV2_STATE;
break;
}
message("\nFMUv2 ver 0x%1X : Rev %x %s\n", hw_version, hw_revision, hw_type);
syslog(LOG_DEBUG, "\nFMUv2 ver 0x%1X : Rev %x %s\n", hw_version, hw_revision, hw_type);
}
/* configure SPI interfaces */
@@ -447,7 +428,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 */
@@ -480,7 +461,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_AMBER);
return -ENODEV;
}
@@ -496,7 +477,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_AMBER);
return -ENODEV;
}
@@ -512,7 +493,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi4 = stm32_spibus_initialize(PX4_SPI_BUS_EXT);
if (!spi4) {
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_EXT);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_EXT);
led_on(LED_AMBER);
return -ENODEV;
}
@@ -529,7 +510,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (!sdio) {
led_on(LED_AMBER);
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;
}
@@ -538,7 +519,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (ret != OK) {
led_on(LED_AMBER);
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;
}
+3 -5
View File
@@ -41,7 +41,6 @@
* Included Files
************************************************************************************/
#include <px4_time.h>
#include <px4_config.h>
#include <stdint.h>
@@ -56,7 +55,6 @@
#include <chip.h>
#include <stm32.h>
#include "board_config.h"
#include <systemlib/err.h>
/************************************************************************************
* Public Functions
@@ -421,8 +419,8 @@ __EXPORT void board_spi_reset(int ms)
stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 0);
/* wait for the sensor rail to reach GND */
px4_usleep(ms * 1000);
warnx("reset done, %d ms", ms);
usleep(ms * 1000);
syslog(LOG_DEBUG, "reset done, %d ms\n", ms);
/* re-enable power */
@@ -430,7 +428,7 @@ __EXPORT void board_spi_reset(int ms)
stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 1);
/* wait a bit before starting SPI, different times didn't influence results */
px4_usleep(100);
usleep(100);
/* reconfigure the SPI pins */
stm32_configgpio(GPIO_SPI1_SCK);
@@ -259,13 +259,13 @@
#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2
#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2
#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN8)
#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN9)
#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8)
#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9)
#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1
#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1
#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN10)
#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN11)
#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN10)
#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11)
/* SPI
*
+10 -28
View File
@@ -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
@@ -130,7 +112,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 */
@@ -415,7 +397,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
hw_version = HW_VER_FMUV3_STATE;
hw_type[1]++;
hw_type[2] = '0';
message("\nPixhack V3 detected, forcing to fmu-v3");
syslog(LOG_INFO, "\nPixhack V3 detected, forcing to fmu-v3");
} else {
@@ -430,12 +412,12 @@ __EXPORT int board_app_initialize(uintptr_t arg)
/* questionable px4_fmu-v2 hardware, try forcing regular FMUv2 (not much else we can do) */
message("\nbad version detected, forcing to fmu-v2");
syslog(LOG_ERR, "\nbad version detected, forcing to fmu-v2");
hw_version = HW_VER_FMUV2_STATE;
break;
}
message("\nFMUv2 ver 0x%1X : Rev %x %s\n", hw_version, hw_revision, hw_type);
syslog(LOG_DEBUG, "\nFMUv2 ver 0x%1X : Rev %x %s\n", hw_version, hw_revision, hw_type);
}
/* configure SPI interfaces */
@@ -446,7 +428,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 */
@@ -479,7 +461,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_AMBER);
return -ENODEV;
}
@@ -495,7 +477,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_AMBER);
return -ENODEV;
}
@@ -511,7 +493,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi4 = stm32_spibus_initialize(PX4_SPI_BUS_EXT);
if (!spi4) {
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_EXT);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_EXT);
led_on(LED_AMBER);
return -ENODEV;
}
@@ -528,7 +510,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (!sdio) {
led_on(LED_AMBER);
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;
}
@@ -537,7 +519,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (ret != OK) {
led_on(LED_AMBER);
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
@@ -421,7 +420,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 */
+7 -25
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
@@ -135,7 +117,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.
// Switch the peripheral rail back on.
@@ -271,7 +253,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.
@@ -311,7 +293,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi1 = stm32_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_RED);
return -ENODEV;
}
@@ -330,7 +312,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
spi2 = stm32_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_RED);
return -ENODEV;
}
@@ -354,8 +336,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;
}
@@ -364,7 +346,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
@@ -223,7 +222,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 */
+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 */
+1 -1
View File
@@ -162,7 +162,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 */
+1 -2
View File
@@ -57,7 +57,6 @@
#include <chip.h>
#include <stm32_gpio.h>
#include "board_config.h"
#include <systemlib/err.h>
/****************************************************************************
* Pre-Processor Definitions
@@ -476,7 +475,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 */
-18
View File
@@ -63,24 +63,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
/****************************************************************************
* Protected Functions
****************************************************************************/
-18
View File
@@ -75,24 +75,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
/****************************************************************************
* Protected Functions
****************************************************************************/
+2 -20
View File
@@ -80,24 +80,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
@@ -136,7 +118,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 */
@@ -238,7 +220,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 */
+2 -19
View File
@@ -58,23 +58,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
/* Card detections requires card support and a card detection GPIO */
#define HAVE_NCD 1
@@ -157,7 +140,7 @@ int stm32_sdio_initialize(void)
sdio_dev = sdio_initialize(SDIO_SLOTNO);
if (!sdio_dev) {
message("[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO);
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO);
return -ENODEV;
}
@@ -168,7 +151,7 @@ int stm32_sdio_initialize(void)
ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev);
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);
return ret;
}
+5 -24
View File
@@ -56,30 +56,11 @@
#include <chip.h>
#include <stm32_gpio.h>
#include "board_config.h"
#include <systemlib/err.h>
/****************************************************************************
* 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
/************************************************************************************
* Public Functions
************************************************************************************/
@@ -140,7 +121,7 @@ __EXPORT int stm32_spi_bus_initialize(void)
spi_sensors = stm32_spibus_initialize(PX4_SPI_BUS_SENSORS);
if (!spi_sensors) {
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);
return -ENODEV;
}
@@ -158,7 +139,7 @@ __EXPORT int stm32_spi_bus_initialize(void)
spi_fram = stm32_spibus_initialize(PX4_SPI_BUS_RAMTRON);
if (!spi_fram) {
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);
return -ENODEV;
}
@@ -178,7 +159,7 @@ __EXPORT int stm32_spi_bus_initialize(void)
spi_baro = stm32_spibus_initialize(PX4_SPI_BUS_BARO);
if (!spi_baro) {
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_BARO);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_BARO);
return -ENODEV;
}
@@ -198,7 +179,7 @@ __EXPORT int stm32_spi_bus_initialize(void)
spi_icm = stm32_spibus_initialize(PX4_SPI_BUS_ICM);
if (!spi_icm) {
message("[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_ICM);
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", PX4_SPI_BUS_ICM);
return -ENODEV;
}
@@ -371,7 +352,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 */
+1
View File
@@ -60,6 +60,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <px4_time.h>
#include <px4_log.h>
+1 -1
View File
@@ -148,7 +148,7 @@ int px4_sem_timedwait(px4_sem_t *s, const struct timespec *abstime)
const unsigned NAMELEN = 32;
char thread_name[NAMELEN] = {};
(void)pthread_getname_np(pthread_self(), thread_name, NAMELEN);
PX4_WARN("%s: px4_sem_timedwait failure: ret: %d, %s", thread_name, ret, strerror(ret));
PX4_WARN("%s: px4_sem_timedwait failure: ret: %d", thread_name, ret);
}
int mret = pthread_mutex_unlock(&(s->lock));
@@ -44,6 +44,7 @@
#include <drivers/drv_hrt.h>
#include <drivers/device/ringbuffer.h>
#include <drivers/drv_device.h>
#include <systemlib/err.h>
#include <uORB/uORB.h>
+2
View File
@@ -43,6 +43,8 @@
#include "batt_smbus.h"
#include <stdlib.h>
extern "C" __EXPORT int batt_smbus_main(int argc, char *argv[]);
struct work_s BATT_SMBUS::_work = {};
@@ -35,6 +35,8 @@
#include <px4_getopt.h>
#include <stdlib.h>
// Driver 'main' command.
extern "C" __EXPORT int ms5525_airspeed_main(int argc, char *argv[]);
@@ -32,8 +32,11 @@
****************************************************************************/
#include "SDP3X.hpp"
#include <px4_getopt.h>
#include <stdlib.h>
// Driver 'main' command.
extern "C" __EXPORT int sdp3x_airspeed_main(int argc, char *argv[]);
@@ -36,6 +36,7 @@
#include <px4_getopt.h>
#include <px4_defines.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
@@ -122,7 +122,7 @@ void LidarLitePWM::print_info()
perf_print_counter(_sample_perf);
perf_print_counter(_read_errors);
perf_print_counter(_sensor_zero_resets);
warnx("poll interval: %u ticks", getMeasureTicks());
PX4_INFO("poll interval: %u ticks", getMeasureTicks());
print_message(_range);
}
@@ -303,8 +303,6 @@ Radar::task_main_trampoline(int argc, char *argv[])
int
Radar::start()
{
ASSERT(_task_handle == -1);
/* start the task */
_task_handle = px4_task_spawn_cmd("ulanding_radar",
SCHED_DEFAULT,
+1
View File
@@ -49,6 +49,7 @@
#include <lib/conversion/rotation.h>
#include <perf/perf_counter.h>
#include <ecl/geo/geo.h>
#include <systemlib/err.h>
#define ADIS16477_GYRO_DEFAULT_RATE 250
#define ADIS16477_GYRO_DEFAULT_DRIVER_FILTER_FREQ 30
+1
View File
@@ -40,6 +40,7 @@
#include <lib/perf/perf_counter.h>
#include <px4_config.h>
#include <systemlib/conversions.h>
#include <systemlib/err.h>
#define DIR_READ 0x80
#define DIR_WRITE 0x00
@@ -73,6 +73,7 @@
#include <mathlib/math/filter/LowPassFilter2p.hpp>
#include <lib/conversion/rotation.h>
#include <platforms/px4_getopt.h>
#include <systemlib/err.h>
/* SPI protocol address bits */
#define DIR_READ(a) ((a) | (1 << 7))

Some files were not shown because too many files have changed in this diff Show More