sdm710-common: camera_motor: handle mid position state
* oppo_motor gets initialized with position in "MID_STATE" Change-Id: I5bbe50b20910f9ea9950caa081577c7216ed8b06
This commit is contained in:
parent
7450d7c4a3
commit
8ccb690079
1 changed files with 2 additions and 1 deletions
|
@ -31,6 +31,7 @@
|
||||||
#define DIRECTION_DOWN "0"
|
#define DIRECTION_DOWN "0"
|
||||||
#define DIRECTION_UP "1"
|
#define DIRECTION_UP "1"
|
||||||
#define HALL_CALIBRATION_DEFAULT "170,170,480,0,0,480,500,0,0,500,1500"
|
#define HALL_CALIBRATION_DEFAULT "170,170,480,0,0,480,500,0,0,500,1500"
|
||||||
|
#define POSITION_MID "2"
|
||||||
#define POSITION_DOWN "1"
|
#define POSITION_DOWN "1"
|
||||||
#define POSITION_UP "0"
|
#define POSITION_UP "0"
|
||||||
#define ENABLED "1"
|
#define ENABLED "1"
|
||||||
|
@ -92,7 +93,7 @@ CameraMotor::CameraMotor() {
|
||||||
Return<void> CameraMotor::onConnect(const hidl_string& cameraId) {
|
Return<void> CameraMotor::onConnect(const hidl_string& cameraId) {
|
||||||
auto motorPosition = get<std::string>(CAMERA_MOTOR_POSITION, "");
|
auto motorPosition = get<std::string>(CAMERA_MOTOR_POSITION, "");
|
||||||
|
|
||||||
if (cameraId == CAMERA_ID_FRONT && motorPosition == POSITION_DOWN) {
|
if (cameraId == CAMERA_ID_FRONT && (motorPosition == POSITION_DOWN || motorPosition == POSITION_MID)) {
|
||||||
LOG(INFO) << "Popping out front camera";
|
LOG(INFO) << "Popping out front camera";
|
||||||
|
|
||||||
set(CAMERA_MOTOR_DIRECTION, DIRECTION_UP);
|
set(CAMERA_MOTOR_DIRECTION, DIRECTION_UP);
|
||||||
|
|
Loading…
Reference in a new issue