Add function to give back fan control to applesmc
This commit is contained in:
parent
44d2ad7b82
commit
8bb61f8633
2 changed files with 20 additions and 2 deletions
16
src/mbpfan.c
16
src/mbpfan.c
|
@ -314,7 +314,7 @@ t_fans *retrieve_fans()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void set_fans_man(t_fans *fans)
|
static void set_fans_mode(t_fans *fans, int mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
t_fans *tmp = fans;
|
t_fans *tmp = fans;
|
||||||
|
@ -324,7 +324,7 @@ void set_fans_man(t_fans *fans)
|
||||||
file = fopen(tmp->fan_manual_path, "rw+");
|
file = fopen(tmp->fan_manual_path, "rw+");
|
||||||
|
|
||||||
if(file != NULL) {
|
if(file != NULL) {
|
||||||
fprintf(file, "%d", 1);
|
fprintf(file, "%d", mode);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,6 +332,18 @@ void set_fans_man(t_fans *fans)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_fans_man(t_fans *fans)
|
||||||
|
{
|
||||||
|
|
||||||
|
set_fans_mode(fans, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_fans_auto(t_fans *fans)
|
||||||
|
{
|
||||||
|
|
||||||
|
set_fans_mode(fans, 0);
|
||||||
|
}
|
||||||
|
|
||||||
t_sensors *refresh_sensors(t_sensors *sensors)
|
t_sensors *refresh_sensors(t_sensors *sensors)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,12 @@ t_fans* retrieve_fans();
|
||||||
*/
|
*/
|
||||||
void set_fans_man(t_fans *fans);
|
void set_fans_man(t_fans *fans);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Given a list of sensors with associated fans
|
||||||
|
* Set them to automatic control
|
||||||
|
*/
|
||||||
|
void set_fans_auto(t_fans *fans);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a list of sensors with associated fans
|
* Given a list of sensors with associated fans
|
||||||
* Change their speed
|
* Change their speed
|
||||||
|
|
Loading…
Add table
Reference in a new issue