mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys,phydat: fix scale_2_str for multi and non dimensional units
This commit is contained in:
parent
238b5d68af
commit
e4382ae5c5
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user