diff options
author | AlejandroColomar <colomar.6.4.3@gmail.com> | 2018-11-05 11:11:55 +0100 |
---|---|---|
committer | AlejandroColomar <colomar.6.4.3@gmail.com> | 2018-11-05 11:11:55 +0100 |
commit | 3dce71a8cbb5d8c26411c83c7b5131e00f5eccb8 (patch) | |
tree | 90e16289afd24149b9acda5dba42816ef19b2cdb | |
parent | dd636486d11673ffdf8d45fa1d16e8d8962f9845 (diff) |
Print resistance +- tolerance% in eng format into log
-rw-r--r-- | modules/proc/src/proc.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/proc/src/proc.cpp b/modules/proc/src/proc.cpp index 9f92341..a8d0097 100644 --- a/modules/proc/src/proc.cpp +++ b/modules/proc/src/proc.cpp @@ -539,7 +539,7 @@ static int proc_resistor (void) char code [6] = {'\0', '\0', '\0', '\0', '\0', '\0'};
float resistance;
- float tolerance;
+ int tolerance;
int i;
int j;
@@ -814,7 +814,8 @@ static int proc_resistor (void) /* Write bands' code into log */
snprintf(user_iface_log.line[user_iface_log.len], LOG_LINE_LEN,
- "Code: \"%s\"", code);
+ "Code: \"%s\"",
+ code);
user_iface_log.lvl[user_iface_log.len] = 0;
(user_iface_log.len)++;
@@ -889,6 +890,13 @@ static int proc_resistor (void) return status;
}
+ /* Write resistance value into log */
+ snprintf(user_iface_log.line[user_iface_log.len], LOG_LINE_LEN,
+ "Resistance: %.2E ± %i% Ohm",
+ resistance, tolerance);
+ user_iface_log.lvl[user_iface_log.len] = 0;
+ (user_iface_log.len)++;
+
/* Measure time */
time_1 = clock();
times = ((double) time_1 - time_0) / CLOCKS_PER_SEC;
|