feat(src): supported set iic address for s2100

This commit is contained in:
Osenberg 2019-04-12 11:31:53 +08:00
parent 9a13909de2
commit 05dc3e99ef
2 changed files with 6 additions and 5 deletions

View File

@ -28,15 +28,15 @@ int main(int argc, char *argv[]) {
api->ConfigStreamRequest(request); api->ConfigStreamRequest(request);
Model model = api->GetModel(); Model model = api->GetModel();
if (model == Model::STANDARD210A) { if (model == Model::STANDARD210A || model == Model::STANDARD2) {
api->SetOptionValue(Option::IIC_ADDRESS_SETTING, 0x31); api->SetOptionValue(Option::IIC_ADDRESS_SETTING, 0x31);
LOG(INFO) << "Set iic address to " << std::hex << "0x" LOG(INFO) << "Set iic address to " << std::hex << "0x"
<< api->GetOptionValue(Option::IIC_ADDRESS_SETTING); << api->GetOptionValue(Option::IIC_ADDRESS_SETTING);
} }
// MYNTEYE-S1030/S2100 don't support this option // MYNTEYE-S1030 don't support this option
if (model == Model::STANDARD2 || model == Model::STANDARD) { if (model == Model::STANDARD) {
LOG(INFO) << "Sorry,MYNTEYE-S1030/S2100 don't support iic address setting"; LOG(INFO) << "Sorry,MYNTEYE-S1030 don't support iic address setting";
return 0; return 0;
} }

View File

@ -45,7 +45,8 @@ const std::map<Model, OptionSupports> option_supports_map = {
Option::IR_CONTROL, Option::MIN_EXPOSURE_TIME, Option::IR_CONTROL, Option::MIN_EXPOSURE_TIME,
Option::DESIRED_BRIGHTNESS, Option::ACCELEROMETER_RANGE, Option::DESIRED_BRIGHTNESS, Option::ACCELEROMETER_RANGE,
Option::GYROSCOPE_RANGE, Option::ACCELEROMETER_LOW_PASS_FILTER, Option::GYROSCOPE_RANGE, Option::ACCELEROMETER_LOW_PASS_FILTER,
Option::GYROSCOPE_LOW_PASS_FILTER, Option::ERASE_CHIP} Option::GYROSCOPE_LOW_PASS_FILTER, Option::IIC_ADDRESS_SETTING,
Option::ERASE_CHIP}
}, },
{Model::STANDARD210A, { {Model::STANDARD210A, {
Option::BRIGHTNESS, Option::BRIGHTNESS,