From 97a72563b800e27aadebe1bf28a5217fa3144bc9 Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Thu, 12 Mar 2015 16:29:17 -0700 Subject: [PATCH] Fixes to compile again for NuttX Signed-off-by: Mark Charlebois --- src/drivers/device/device_nuttx.h | 8 ++++---- src/drivers/device/module.mk | 8 ++++---- src/platforms/px4_posix.h | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/drivers/device/device_nuttx.h b/src/drivers/device/device_nuttx.h index 87e5e2abe0..3d5737cee4 100644 --- a/src/drivers/device/device_nuttx.h +++ b/src/drivers/device/device_nuttx.h @@ -51,6 +51,8 @@ #include #include +#include + /** * Namespace encapsulating all device framework classes, functions and data. */ @@ -89,7 +91,6 @@ public: */ virtual int init(); -#if 0 /** * Read directly from the device. * @@ -122,7 +123,6 @@ public: * @return Negative errno on error, OK or positive value on success. */ virtual int ioctl(unsigned operation, unsigned &arg); -#endif /* device bus types for DEVID @@ -513,7 +513,7 @@ protected: * * @param offset Register offset in bytes from the base address. */ - unsigned long reg(uint32_t offset) { + uint32_t reg(uint32_t offset) { return *(volatile uint32_t *)(_base + offset); } @@ -545,7 +545,7 @@ protected: } private: - unsigned long _base; + uint32_t _base; }; } // namespace device diff --git a/src/drivers/device/module.mk b/src/drivers/device/module.mk index 216fae1ab3..522639dc17 100644 --- a/src/drivers/device/module.mk +++ b/src/drivers/device/module.mk @@ -35,15 +35,15 @@ # Build the device driver framework. # -#ifeq ($(PX4_TARGET_OS),nuttx) +ifeq ($(PX4_TARGET_OS),nuttx) SRCS = \ device.cpp \ cdev.cpp \ i2c.cpp \ pio.cpp \ spi.cpp -#endif -#ifeq ($(PX4_TARGET_OS),linux) +endif +ifeq ($(PX4_TARGET_OS),linux) SRCS = vcdev.cpp \ vdevice.cpp -#endif +endif diff --git a/src/platforms/px4_posix.h b/src/platforms/px4_posix.h index 88b8f4e80c..5694d4e865 100644 --- a/src/platforms/px4_posix.h +++ b/src/platforms/px4_posix.h @@ -40,6 +40,7 @@ #pragma once #include +#include #include #include