Modified for compatibility with Rev.E. hardware
Fork of AkmSensor by
Diff: akmsensormanager.cpp
- Revision:
- 30:5a241d9b3262
- Parent:
- 29:b488d2c89fba
- Child:
- 34:1ea3357c8d9a
--- a/akmsensormanager.cpp Fri Mar 17 23:29:20 2017 +0000 +++ b/akmsensormanager.cpp Fri Apr 28 20:32:31 2017 +0000 @@ -350,13 +350,13 @@ case Message::CMD_SET_SENSOR_INDEX: { uint8_t index = (uint8_t)msg.getArgument(0); - if( index >= sensorNum ){ - resMsg.setArgument(0, 1); - MSG("#Error: Set Sensor Index=%d.\r\n", sensorIndex); - }else{ + if(msg.getArgNum() == 1 && index<sensorNum){ resMsg.setArgument(0, 0); sensorIndex = index; MSG("#Set Sensor Index=%d.\r\n", sensorIndex); + }else{ + resMsg.setArgument(0, 1); + MSG("#Error: Set Sensor Index=%d.\r\n", sensorIndex); } throwMessage(&resMsg); break; @@ -460,6 +460,7 @@ case Message::CMD_IR_GET_OPERATION_MODE_EEPROM: case Message::CMD_IR_SET_OPERATION_MODE_EEPROM: case Message::CMD_ANGLE_ZERO_RESET: + case Message::CMD_ANGLE_READ: case Message::CMD_REG_WRITE: case Message::CMD_REG_WRITEN: case Message::CMD_REG_READ: