1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 15:03:53 +01:00

Merge pull request #8583 from gebart/pr/phydat-align

sys/phydat: align numbers, remove index if dim == 1
This commit is contained in:
Joakim Nohlgård 2018-03-27 14:34:41 +02:00 committed by GitHub
commit 7f454d659b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,13 +49,18 @@ void phydat_dump(phydat_t *data, uint8_t dim)
scale_prefix = phydat_prefix_from_scale(data->scale);
}
printf("\t[%i] ", (int)i);
printf("\t");
if (dim > 1) {
printf("[%u] ", (unsigned int)i);
}
else {
printf(" ");
}
if (scale_prefix) {
printf("%i %c", (int)data->val[i], scale_prefix);
printf("%6d %c", (int)data->val[i], scale_prefix);
}
else if (data->scale == 0) {
printf("%i", (int)data->val[i]);
printf("%6d", (int)data->val[i]);
}
else if ((data->scale > -5) && (data->scale < 0)) {
char num[8];