diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-06 15:41:40 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-06 15:41:40 +0000 |
commit | 2eef164c17fbddd23fff2b83cd49d03b9577fdcd (patch) | |
tree | 1839c182baf42d4b8cdfc309ed73eddd6b14c43b /os/hal/lib/peripherals | |
parent | cd2beca38c5a44b7a2cfbae68fa7e157e6986c39 (diff) | |
download | ChibiOS-2eef164c17fbddd23fff2b83cd49d03b9577fdcd.tar.gz ChibiOS-2eef164c17fbddd23fff2b83cd49d03b9577fdcd.tar.bz2 ChibiOS-2eef164c17fbddd23fff2b83cd49d03b9577fdcd.zip |
Modified to allow multiple inheritance.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9042 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/lib/peripherals')
-rw-r--r-- | os/hal/lib/peripherals/include/hal_accelerometer.h | 8 | ||||
-rw-r--r-- | os/hal/lib/peripherals/include/hal_compass.h | 10 | ||||
-rw-r--r-- | os/hal/lib/peripherals/include/hal_gyroscope.h | 10 | ||||
-rw-r--r-- | os/hal/lib/peripherals/include/hal_sensors.h | 8 |
4 files changed, 30 insertions, 6 deletions
diff --git a/os/hal/lib/peripherals/include/hal_accelerometer.h b/os/hal/lib/peripherals/include/hal_accelerometer.h index f6b4229af..c557dc96f 100644 --- a/os/hal/lib/peripherals/include/hal_accelerometer.h +++ b/os/hal/lib/peripherals/include/hal_accelerometer.h @@ -46,8 +46,14 @@ /**
* @brief BaseAccelerometer specific methods.
*/
+#define _base_accelerometer_methods_alone
+
+/**
+ * @brief BaseAccelerometer specific methods with inherited ones.
+ */
#define _base_accelerometer_methods \
- _base_sensor_methods
+ _base_sensor_methods \
+ _base_accelerometer_methods_alone
/**
* @brief @p BaseAccelerometer virtual methods table.
diff --git a/os/hal/lib/peripherals/include/hal_compass.h b/os/hal/lib/peripherals/include/hal_compass.h index 22bf22844..9d4678878 100644 --- a/os/hal/lib/peripherals/include/hal_compass.h +++ b/os/hal/lib/peripherals/include/hal_compass.h @@ -46,9 +46,15 @@ /**
* @brief BaseCompass specific methods.
*/
+#define _base_compass_methods_alone
+
+/**
+ * @brief BaseCompass specific methods with inherited ones.
+ */
#define _base_compass_methods \
- _base_sensor_methods
-
+ _base_sensor_methods \
+ _base_compass_methods_alone
+
/**
* @brief @p BaseCompass virtual methods table.
*/
diff --git a/os/hal/lib/peripherals/include/hal_gyroscope.h b/os/hal/lib/peripherals/include/hal_gyroscope.h index 142832094..4d551d777 100644 --- a/os/hal/lib/peripherals/include/hal_gyroscope.h +++ b/os/hal/lib/peripherals/include/hal_gyroscope.h @@ -46,14 +46,20 @@ /**
* @brief BaseGyroscope specific methods.
*/
-#define _base_gyroscope_methods \
- _base_sensor_methods \
+#define _base_gyroscope_methods_alone \
/* Remove the calibration data.*/ \
msg_t (*reset_calibration)(void *instance); \
/* Invokes the calibration procedure.*/ \
msg_t (*calibrate)(void *instance);
/**
+ * @brief BaseGyroscope specific methods with inherited ones.
+ */
+#define _base_gyroscope_methods \
+ _base_sensor_methods \
+ _base_gyroscope_methods_alone
+
+/**
* @brief @p BaseGyroscope virtual methods table.
*/
struct BaseGyroscopeVMT {
diff --git a/os/hal/lib/peripherals/include/hal_sensors.h b/os/hal/lib/peripherals/include/hal_sensors.h index 6254f036e..b722161b6 100644 --- a/os/hal/lib/peripherals/include/hal_sensors.h +++ b/os/hal/lib/peripherals/include/hal_sensors.h @@ -44,7 +44,7 @@ /**
* @brief BaseSensor specific methods.
*/
-#define _base_sensor_methods \
+#define _base_sensor_methods_alone \
/* Get number of axes.*/ \
size_t (*get_axes_number)(void *instance); \
/* Reads the sensor raw data.*/ \
@@ -53,6 +53,12 @@ msg_t (*read_cooked)(void *instance, float axes[]);
/**
+ * @brief BaseSensor specific methods with inherited ones.
+ */
+#define _base_sensor_methods \
+ _base_sensor_methods_alone
+
+/**
* @brief @p BaseSensor virtual methods table.
*/
struct BaseSensorVMT {
|