Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
Diff: akmsensormanager.cpp
- Revision:
- 17:9abb7c28709c
- Parent:
- 16:d85be9bafb80
- Child:
- 18:b7182d5ad8d5
--- a/akmsensormanager.cpp Wed Jan 04 00:52:30 2017 +0000 +++ b/akmsensormanager.cpp Wed Jan 18 21:40:53 2017 +0000 @@ -13,7 +13,6 @@ #include "Message.h" #include "mcp342x.h" #include "I2CNano.h" -#include "tca9554a.h" #define MAGNETOMETER_ID 0x0A @@ -79,6 +78,7 @@ AkmSensor* sensor = NULL; switch(primaryId){ + case AkmSensor::AKM_PRIMARY_ID_AKD_SPI: case AkmSensor::AKM_PRIMARY_ID_AKD_I2C: { @@ -92,6 +92,7 @@ } break; } + case AkmSensor::AKM_PRIMARY_ID_ANGLE_SENSOR: { if(subId == Ak7451Ctrl::SUB_ID_AK7451){ @@ -106,6 +107,7 @@ } break; } + case AkmSensor::AKM_PRIMARY_ID_UNIPOLAR: case AkmSensor::AKM_PRIMARY_ID_OMNIPOLAR: case AkmSensor::AKM_PRIMARY_ID_LATCH: @@ -116,7 +118,7 @@ sensor = hallswitch; break; } - case AkmSensor::AKM_PRIMARY_ID_LINEAR_SENSOR_LEGACY: +// case AkmSensor::AKM_PRIMARY_ID_LINEAR_SENSOR_LEGACY: case AkmSensor::AKM_PRIMARY_ID_LINEAR_SENSOR: case AkmSensor::AKM_PRIMARY_ID_CURRENT_SENSOR: case AkmSensor::AKM_PRIMARY_ID_MISC_ANALOG: @@ -125,6 +127,7 @@ sensor = analogsensor; break; } + case AkmSensor::AKM_PRIMARY_ID_IR_SENSOR: { if(subId == Ak9750Ctrl::SUB_ID_AK9750){ @@ -142,9 +145,10 @@ break; } + default: { - MSG("#Can't find ID=%d SubID=%d %s\r\n", primaryId, subId, AKM_PRIMARY_ID_STR[primaryId]); + MSG("#Can't find ID=%d SubID=%d %s\r\n", primaryId, subId, AKM_PRIMARY_ID_STR[primaryId]); return NULL; // couldn't find } }