Add function to give back fan control to applesmc

This commit is contained in:
otilmans@gmail.com 2014-07-21 23:44:13 +02:00
parent 44d2ad7b82
commit 8bb61f8633
2 changed files with 20 additions and 2 deletions

View file

@ -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;
@ -324,7 +324,7 @@ void set_fans_man(t_fans *fans)
file = fopen(tmp->fan_manual_path, "rw+");
if(file != NULL) {
fprintf(file, "%d", 1);
fprintf(file, "%d", mode);
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)
{

View file

@ -79,6 +79,12 @@ t_fans* retrieve_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
* Change their speed