OSTC parser whitespace cleanups
This is pure whitespace cleanup, where the hw_ostc_parser.c file had a number of lines with eight spaces instead of tabs. They were right next to lines with tabs, so it really made no sense. I only noticed because some of it was arbitrary difference to Jef's upstream code, and it stood out like a sore thumb when trying to re-generate our local changes wrt upstream. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c889348583
commit
bec9ca9e3c
@ -114,7 +114,7 @@ typedef struct hw_ostc_layout_t {
|
|||||||
unsigned int deco_info1;
|
unsigned int deco_info1;
|
||||||
unsigned int deco_info2;
|
unsigned int deco_info2;
|
||||||
unsigned int decomode;
|
unsigned int decomode;
|
||||||
unsigned int battery_percentage;
|
unsigned int battery_percentage;
|
||||||
} hw_ostc_layout_t;
|
} hw_ostc_layout_t;
|
||||||
|
|
||||||
typedef struct hw_ostc_gasmix_t {
|
typedef struct hw_ostc_gasmix_t {
|
||||||
@ -170,7 +170,7 @@ static const hw_ostc_layout_t hw_ostc_layout_ostc = {
|
|||||||
49, /* deco_info1 */
|
49, /* deco_info1 */
|
||||||
50, /* deco_info1 */
|
50, /* deco_info1 */
|
||||||
51, /* decomode */
|
51, /* decomode */
|
||||||
0, /* battery percentage TBD */
|
0, /* battery percentage TBD */
|
||||||
};
|
};
|
||||||
|
|
||||||
static const hw_ostc_layout_t hw_ostc_layout_frog = {
|
static const hw_ostc_layout_t hw_ostc_layout_frog = {
|
||||||
@ -188,7 +188,7 @@ static const hw_ostc_layout_t hw_ostc_layout_frog = {
|
|||||||
49, /* deco_info1 */
|
49, /* deco_info1 */
|
||||||
50, /* deco_info2 */
|
50, /* deco_info2 */
|
||||||
51, /* decomode */
|
51, /* decomode */
|
||||||
0, /* battery percentage TBD */
|
0, /* battery percentage TBD */
|
||||||
};
|
};
|
||||||
|
|
||||||
static const hw_ostc_layout_t hw_ostc_layout_ostc3 = {
|
static const hw_ostc_layout_t hw_ostc_layout_ostc3 = {
|
||||||
@ -206,7 +206,7 @@ static const hw_ostc_layout_t hw_ostc_layout_ostc3 = {
|
|||||||
77, /* deco_info1 */
|
77, /* deco_info1 */
|
||||||
78, /* deco_info2 */
|
78, /* deco_info2 */
|
||||||
79, /* decomode */
|
79, /* decomode */
|
||||||
59, /* battery percentage */
|
59, /* battery percentage */
|
||||||
};
|
};
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
@ -306,7 +306,7 @@ hw_ostc_parser_cache (hw_ostc_parser_t *parser)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// The first fixed setpoint is the initial setpoint in CCR mode.
|
// The first fixed setpoint is the initial setpoint in CCR mode.
|
||||||
if (data[82] == OSTC3_CC) {
|
if (data[82] == OSTC3_CC) {
|
||||||
initial_setpoint = data[60];
|
initial_setpoint = data[60];
|
||||||
}
|
}
|
||||||
// Initial CNS
|
// Initial CNS
|
||||||
@ -615,28 +615,28 @@ hw_ostc_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned
|
|||||||
break;
|
break;
|
||||||
case DC_FIELD_STRING:
|
case DC_FIELD_STRING:
|
||||||
switch(flags) {
|
switch(flags) {
|
||||||
case 0: /* serial */
|
case 0: /* serial */
|
||||||
string->desc = "Serial";
|
string->desc = "Serial";
|
||||||
snprintf(buf, BUFLEN, "%u", parser->serial);
|
snprintf(buf, BUFLEN, "%u", parser->serial);
|
||||||
break;
|
break;
|
||||||
case 1: /* battery */
|
case 1: /* battery */
|
||||||
string->desc = "Battery at end";
|
string->desc = "Battery at end";
|
||||||
unsigned int percentage = (unsigned int) data[layout->battery_percentage];
|
unsigned int percentage = (unsigned int) data[layout->battery_percentage];
|
||||||
if (percentage != 0xFF && (version == 0x23 || version == 0x24)) {
|
if (percentage != 0xFF && (version == 0x23 || version == 0x24)) {
|
||||||
percentage = percentage>100? 100: percentage;
|
percentage = percentage>100? 100: percentage;
|
||||||
snprintf(buf, BUFLEN, "%.2fV, %u%% remaining",
|
snprintf(buf, BUFLEN, "%.2fV, %u%% remaining",
|
||||||
array_uint16_le (data + layout->battery) / 1000.0,
|
array_uint16_le (data + layout->battery) / 1000.0,
|
||||||
percentage);
|
percentage);
|
||||||
} else {
|
} else {
|
||||||
snprintf(buf, BUFLEN, "%.2fV", array_uint16_le (data + layout->battery) / 1000.0);
|
snprintf(buf, BUFLEN, "%.2fV", array_uint16_le (data + layout->battery) / 1000.0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2: /* desat */
|
case 2: /* desat */
|
||||||
string->desc = "Desat time";
|
string->desc = "Desat time";
|
||||||
snprintf(buf, BUFLEN, "%0u:%02u", array_uint16_le (data + layout->desat) / 60,
|
snprintf(buf, BUFLEN, "%0u:%02u", array_uint16_le (data + layout->desat) / 60,
|
||||||
array_uint16_le (data + layout->desat) % 60);
|
array_uint16_le (data + layout->desat) % 60);
|
||||||
break;
|
break;
|
||||||
case 3: /* firmware */
|
case 3: /* firmware */
|
||||||
string->desc = "FW Version";
|
string->desc = "FW Version";
|
||||||
/* OSTC4 stores firmware as XXXX XYYY YYZZ ZZZB, -> X.Y.Z beta? */
|
/* OSTC4 stores firmware as XXXX XYYY YYZZ ZZZB, -> X.Y.Z beta? */
|
||||||
if (parser->model == OSTC4) {
|
if (parser->model == OSTC4) {
|
||||||
@ -653,7 +653,7 @@ hw_ostc_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4: /* Deco model */
|
case 4: /* Deco model */
|
||||||
string->desc = "Deco model";
|
string->desc = "Deco model";
|
||||||
if (((version == 0x23 || version == 0x24) && data[layout->decomode] == OSTC3_ZHL16) ||
|
if (((version == 0x23 || version == 0x24) && data[layout->decomode] == OSTC3_ZHL16) ||
|
||||||
(version == 0x22 && data[layout->decomode] == FROG_ZHL16) ||
|
(version == 0x22 && data[layout->decomode] == FROG_ZHL16) ||
|
||||||
@ -668,7 +668,7 @@ hw_ostc_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned
|
|||||||
else
|
else
|
||||||
return DC_STATUS_DATAFORMAT;
|
return DC_STATUS_DATAFORMAT;
|
||||||
break;
|
break;
|
||||||
case 5: /* Deco model info */
|
case 5: /* Deco model info */
|
||||||
string->desc = "Deco model info";
|
string->desc = "Deco model info";
|
||||||
if (((version == 0x23 || version == 0x24) && data[layout->decomode] == OSTC3_ZHL16) ||
|
if (((version == 0x23 || version == 0x24) && data[layout->decomode] == OSTC3_ZHL16) ||
|
||||||
(version == 0x22 && data[layout->decomode] == FROG_ZHL16) ||
|
(version == 0x22 && data[layout->decomode] == FROG_ZHL16) ||
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user