updated on Fri Jan 6 08:01:17 UTC 2012
[aur-mirror.git] / thinkfan-t410 / thinkfan.c.patch
blobbe47d403772c984ce9602b2ce90bb1f8949e00d9
1 --- /home/peto/x/thinkfan-0.7.1/thinkfan.c 2010-06-14 01:31:18.000000000 +0200
2 +++ ./thinkfan.c 2010-10-11 17:12:20.000000000 +0200
3 @@ -43,13 +43,17 @@
4 prefix = "\n"; // It is set to "" by the output macros
6 // Set initial fan level...
7 - lvl_idx = config->num_limits - 1;
8 + lvl_idx = 0;
9 b_temp = temp = config->get_temp();
10 - if (errcnt) return errcnt;
11 - while ((temp <= config->limits[lvl_idx].low) \
12 - && (lvl_idx > 0)) lvl_idx--;
13 + if (errcnt)
14 + return errcnt;
15 + while ((temp > config->limits[lvl_idx].high) \
16 + && (lvl_idx > config->num_limits- 1))
17 + {
18 + lvl_idx++;
19 + }
20 set_fan;
23 /**********************************************
24 * Main loop. This is the actual fan control.
25 **********************************************/
26 @@ -59,6 +63,13 @@
28 // depending on the command line, this might also call depulse()
29 temp = config->get_temp();
30 + //if (temp != 0 && last_temp == 0)
31 + // last_temp = temp;
33 + // check whether the value is correct
34 + if (temp == 0 || last_temp == 0) {
35 + continue;
36 + }
38 // Write current fan level to IBM_FAN one cycle before the watchdog
39 // timeout ends, to let it know we're alive.