Updated coolant to use new output system
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Sun, 14 Jan 2018 22:55:14 +0000 (14:55 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Sun, 14 Jan 2018 22:55:14 +0000 (14:55 -0800)
src/avr/src/coolant.c

index 46ec802646279787f510e7cc15a6418ef4571c5c..4f8fa36ab30e5c5354c83b1e114614625cb5934d 100644 (file)
 \******************************************************************************/
 
 #include "coolant.h"
-#include "config.h"
 
-#include <avr/io.h>
+#include "config.h"
+#include "outputs.h"
 
 
-void coolant_init() {
-  OUTSET_PIN(SWITCH_1_PIN); // High
-  DIRSET_PIN(SWITCH_1_PIN); // Output
-  OUTSET_PIN(SWITCH_2_PIN); // High
-  DIRSET_PIN(SWITCH_2_PIN); // Output
-}
+void coolant_init() {}
 
 
-void coolant_set_mist(bool x) {SET_PIN(SWITCH_1_PIN, !x);}
-void coolant_set_flood(bool x) {SET_PIN(SWITCH_2_PIN, !x);}
-bool coolant_get_mist() {return OUT_PIN(SWITCH_1_PIN);}
-bool coolant_get_flood() {return OUT_PIN(SWITCH_2_PIN);}
+void coolant_set_mist(bool x) {outputs_set_active(SWITCH_1_PIN, x);}
+void coolant_set_flood(bool x) {outputs_set_active(SWITCH_2_PIN, x);}
+bool coolant_get_mist() {return outputs_is_active(SWITCH_1_PIN);}
+bool coolant_get_flood() {return outputs_is_active(SWITCH_2_PIN);}