1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-31 17:31:18 +01:00

Merge pull request #7250 from smlng/sys/phydat/enh_scale2str

sys, phydat: omit scale to string conversion if not applicable
This commit is contained in:
Hauke Petersen 2017-08-25 15:17:02 +02:00 committed by GitHub
commit 7f14e15273

View File

@ -32,7 +32,22 @@ void phydat_dump(phydat_t *data, uint8_t dim)
}
printf("Data:");
for (uint8_t i = 0; i < dim; i++) {
char scale_str = phydat_scale_to_str(data->scale);
char scale_str;
switch (data->unit) {
case UNIT_UNDEF:
case UNIT_NONE:
case UNIT_M2:
case UNIT_M3:
case UNIT_PERCENT:
case UNIT_TEMP_C:
case UNIT_TEMP_F:
/* no string conversion */
scale_str = '\0';
break;
default:
scale_str = phydat_scale_to_str(data->scale);
}
printf("\t[%i] ", (int)i);