sensor_desc[s].minDelay = sensor_get_min_delay(s);
sensor_desc[s].maxDelay = sensor_get_max_delay(s);
- ALOGV("Sensor %d (%s) type(%d) minD(%d) maxD(%d) flags(%2.2x)\n",
+ ALOGV("Sensor %d (%s) type(%d) minD(%d) maxD(%zd) flags(%2.2zx)\n",
s, sensor[s].friendly_name, sensor_desc[s].type,
sensor_desc[s].minDelay, sensor_desc[s].maxDelay,
sensor_desc[s].flags);
/* Set default scaling - if num_channels is zero, we have one channel */
- sensor[s].channel[0].opt_scale = 1;
+ sensor[s].channel[0].opt_scale = (sensor_type == SENSOR_TYPE_ACCELEROMETER) ? -1 : 1;
for (c = 1; c < num_channels; c++)
- sensor[s].channel[c].opt_scale = 1;
+ sensor[s].channel[c].opt_scale = sensor[s].channel[0].opt_scale;
for (c = 0; c < num_channels; c++) {
/* Check the presence of the channel's input_path */
ch_name = sensor_catalog[catalog_index].channel[c].name;
sprintf(suffix, "%s.opt_scale", ch_name);
if (!sensor_get_fl_prop(s, suffix, &opt_scale))
- sensor[s].channel[c].opt_scale = opt_scale;
+ sensor[s].channel[c].opt_scale *= opt_scale;
}
} else {
if (!sensor_get_fl_prop(s, "opt_scale", &opt_scale))