Changeset 290

Show
Ignore:
Timestamp:
03/02/99 09:08:29 (14 years ago)
Author:
frodo
Message:

Finally fixed the misdetect error.

Location:
lm-sensors/trunk/prog/detect
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/detect/detect.pl

    r287 r290  
    744744 
    745745  # Find out whether our new entry should go into the detected or the 
    746   # misdetected list. We only compare main i2c_addr here; so we can have 
    747   # the unlikely case that we replace a subsidiary i2c_addr with a higher 
    748   # confidence value. Too bad. 
     746  # misdetected list. We compare all i2c addresses; if at least one matches, 
     747  # but our conf value is lower, we assume this is a misdetect. 
     748  @hash_addrs = ($datahash->{i2c_addr}); 
     749  push @hash_addrs, @{$datahash->{i2c_sub_addrs}} 
     750       if exists $datahash->{i2c_sub_addrs}; 
    749751  $put_in_detected = 1; 
    750752  FIND_LOOP: 
     
    752754    foreach $detected_entry (@{$main_entry->{detected}}) { 
    753755      if ($detected_entry->{i2c_devnr} == $datahash->{i2c_devnr} and 
    754           $detected_entry->{i2c_addr} == $datahash->{i2c_addr}) { 
     756          any_list_match \@entry_addrs, \@hash_addrs) { 
    755757        if ($detected_entry->{conf} >= $datahash->{conf}) { 
    756758          $put_in_detected = 0; 
     
    891893  } 
    892894 
    893   # Nor found? OK, put it in the detected list 
     895  # Not found? OK, put it in the detected list 
    894896  push @$new_detected_ref, $datahash; 
    895897} 
     
    899901# $_[2]: The name of the algorithm, as appearing in /proc/bus/i2c 
    900902# $_[3]: The driver of the adapter 
     903# @_[4..]: Addresses not to scan 
    901904sub scan_adapter 
    902905{ 
     
    935938            @chips = sort @chips; 
    936939            foreach $other_addr (sort @chips) { 
    937               printf(" %02x",$other_addr); 
     940              printf(" 0x%02x",$other_addr); 
    938941            } 
    939942          } 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r287 r290  
    744744 
    745745  # Find out whether our new entry should go into the detected or the 
    746   # misdetected list. We only compare main i2c_addr here; so we can have 
    747   # the unlikely case that we replace a subsidiary i2c_addr with a higher 
    748   # confidence value. Too bad. 
     746  # misdetected list. We compare all i2c addresses; if at least one matches, 
     747  # but our conf value is lower, we assume this is a misdetect. 
     748  @hash_addrs = ($datahash->{i2c_addr}); 
     749  push @hash_addrs, @{$datahash->{i2c_sub_addrs}} 
     750       if exists $datahash->{i2c_sub_addrs}; 
    749751  $put_in_detected = 1; 
    750752  FIND_LOOP: 
     
    752754    foreach $detected_entry (@{$main_entry->{detected}}) { 
    753755      if ($detected_entry->{i2c_devnr} == $datahash->{i2c_devnr} and 
    754           $detected_entry->{i2c_addr} == $datahash->{i2c_addr}) { 
     756          any_list_match \@entry_addrs, \@hash_addrs) { 
    755757        if ($detected_entry->{conf} >= $datahash->{conf}) { 
    756758          $put_in_detected = 0; 
     
    891893  } 
    892894 
    893   # Nor found? OK, put it in the detected list 
     895  # Not found? OK, put it in the detected list 
    894896  push @$new_detected_ref, $datahash; 
    895897} 
     
    899901# $_[2]: The name of the algorithm, as appearing in /proc/bus/i2c 
    900902# $_[3]: The driver of the adapter 
     903# @_[4..]: Addresses not to scan 
    901904sub scan_adapter 
    902905{ 
     
    935938            @chips = sort @chips; 
    936939            foreach $other_addr (sort @chips) { 
    937               printf(" %02x",$other_addr); 
     940              printf(" 0x%02x",$other_addr); 
    938941            } 
    939942          }