Changeset 4717

Show
Ignore:
Timestamp:
08/26/07 22:36:46 (1 year ago)
Author:
khali
Message:

Move the printing of the current temperature out of print_temp_info().
That way we don't need to use an arbitrary value to carry the fault
information.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/branches/lm-sensors-3.0.0/prog/sensors/chips.c

    r4716 r4717  
    2323#include <stdlib.h> 
    2424#include <string.h> 
    25 #include <math.h> 
    2625 
    2726#include "main.h" 
     
    4241 
    4342/* symbolic constants for minmax defined above */ 
    44 static void print_temp_info(float n_cur, float n_over, float n_hyst, 
    45                             int minmax) 
    46 
    47         /* note: deg_ctof() will preserve HUGEVAL */ 
     43static void print_temp_limits(float n_over, float n_hyst, 
     44                              int minmax) 
     45
    4846        if (fahrenheit) { 
    49                 n_cur = deg_ctof(n_cur); 
    5047                n_over = deg_ctof(n_over); 
    5148                n_hyst = deg_ctof(n_hyst); 
    5249        } 
    53  
    54         if (n_cur != HUGE_VAL) 
    55                 printf("%+6.1f%s  ", n_cur, degstr); 
    56         else 
    57                 printf("   FAULT  "); 
    5850 
    5951        if (minmax == MINMAX) 
     
    231223        } 
    232224 
    233         if (TEMP_FEATURE(SENSORS_FEATURE_TEMP_FAULT) && 
    234             TEMP_FEATURE_VAL(SENSORS_FEATURE_TEMP_FAULT)) 
    235                 val = HUGE_VAL; 
    236  
    237225        print_label(label, label_size); 
    238226        free(label); 
    239227 
    240         print_temp_info(val, max, min, type); 
     228        if (TEMP_FEATURE(SENSORS_FEATURE_TEMP_FAULT) && 
     229            TEMP_FEATURE_VAL(SENSORS_FEATURE_TEMP_FAULT)) { 
     230                printf("   FAULT  "); 
     231        } else { 
     232                if (fahrenheit) 
     233                        val = deg_ctof(val); 
     234                printf("%+6.1f%s  ", val, degstr); 
     235        } 
     236        print_temp_limits(max, min, type); 
    241237 
    242238        /* ALARM features */