iio: Always set the scale
When calling process_scan_1(), make sure to always set the scale to 1.0 so it always has a default value.
This commit is contained in:
@@ -533,6 +533,9 @@ process_scan_1 (char *data,
|
||||
gboolean *ch_present)
|
||||
{
|
||||
int k;
|
||||
|
||||
*ch_scale = 1.0;
|
||||
|
||||
for (k = 0; k < buffer_data->channels_count; k++) {
|
||||
if (strcmp (buffer_data->channels[k]->name, ch_name) != 0)
|
||||
continue;
|
||||
@@ -559,8 +562,6 @@ process_scan_1 (char *data,
|
||||
*ch_val = (int) val;
|
||||
if (buffer_data->channels[k]->scale)
|
||||
*ch_scale = buffer_data->channels[k]->scale;
|
||||
else
|
||||
*ch_scale = 1.0;
|
||||
*ch_present = TRUE;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user