mbpfan-josie

Expose fans and sensors globally

44d2ad7b821fb781aa24403bed90ad3acc13510b
otilmans@gmail.com <otilmans@gmail.com> · 2014-07-21T23:43 · browse files at this commit

parents: f5f61cc

diff --git a/src/global.h b/src/global.h
index 472bad3..9b64acf 100644
--- a/src/global.h
+++ b/src/global.h
@@ -23,5 +23,7 @@ struct s_fans {
 typedef struct s_sensors t_sensors;
 typedef struct s_fans t_fans;
 
+extern t_sensors* sensors;
+extern t_fans* fans;
 
 #endif
\ No newline at end of file
diff --git a/src/mbpfan.c b/src/mbpfan.c
index d31c3ad..40524a2 100755
--- a/src/mbpfan.c
+++ b/src/mbpfan.c
@@ -59,6 +59,9 @@ int max_temp = 86;   // do not set it > 90
 
 int polling_interval = 7;
 
+t_sensors* sensors = NULL;
+t_fans* fans = NULL;
+
 
 bool is_legacy_kernel()
 {
@@ -486,8 +489,8 @@ void mbpfan()
 
     retrieve_settings(NULL);
 
-    t_sensors* sensors = retrieve_sensors();
-    t_fans* fans = retrieve_fans();
+    sensors = retrieve_sensors();
+    fans = retrieve_fans();
 
     set_fans_man(fans);
     new_temp = get_temp(sensors);