Add pump code to Makefile
This commit is contained in:
@@ -11,7 +11,7 @@ RM = rm -f
|
|||||||
BUILD_DIR = build
|
BUILD_DIR = build
|
||||||
OBJ_DIR = $(BUILD_DIR)/obj
|
OBJ_DIR = $(BUILD_DIR)/obj
|
||||||
|
|
||||||
SRCS_C = source/adc.c source/moisture.c source/main.c
|
SRCS_C = source/adc.c source/moisture.c source/main.c source/pump.c
|
||||||
|
|
||||||
OBJS = $(addprefix $(OBJ_DIR)/, $(notdir $(SRCS_C:.c=.o)))
|
OBJS = $(addprefix $(OBJ_DIR)/, $(notdir $(SRCS_C:.c=.o)))
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
void pumpsInit(void);
|
void pumpsInit(void);
|
||||||
void pumpsTrigger(uint8_t digital_pins, int16_t milliseconds);
|
void triggerPump(uint8_t digital_pins, int16_t milliseconds);
|
||||||
void waterPlant(void);
|
void waterPlant(void);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ void pumpsInit(void) {
|
|||||||
(1 << PUMP_D5) |
|
(1 << PUMP_D5) |
|
||||||
(1 << PUMP_D4) |
|
(1 << PUMP_D4) |
|
||||||
(1 << PUMP_D3) |
|
(1 << PUMP_D3) |
|
||||||
0 | 0 | 0 ));
|
0 | 0 | 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void triggerPump(int8_t pump_pin, int16_t milliseconds) {
|
void triggerPump(int8_t pump_pin, int16_t milliseconds) {
|
||||||
@@ -21,7 +21,7 @@ void triggerPump(int8_t pump_pin, int16_t milliseconds) {
|
|||||||
// NOTE: watchout for overflows!! create a safety net.
|
// NOTE: watchout for overflows!! create a safety net.
|
||||||
|
|
||||||
// Turn off pump
|
// Turn off pump
|
||||||
PORTD &= ~(1 << pump_pin);
|
//PORTD &= ~(1 << pump_pin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void waterPlant(void) {
|
void waterPlant(void) {
|
||||||
|
|||||||
Reference in New Issue
Block a user