Commits

Anonymous committed f205e4d

Refined clearing and setting of pins.

Comments (0)

Files changed (2)

 #include <avr/io.h>
 #include <util/delay.h>
 
+#include "util.h"
+
+void debug_led(int status) {
+	switch (status) {
+		case OFF:
+			CLEAR_PIN(PORTC, PC6);
+			break;
+		case TOGGLE:
+			TOGGLE_PIN(PORTC, PC6);
+			break;
+		case ON: default:
+			SET_PIN(PORTC, PC6);
+			break;
+	}
+}
+
 int main(void) {
 	DDRC |= 1<<PC6;
 
 	while (1) {
 		_delay_ms(125);
 		_delay_ms(125);
-		PORTC ^= 1<<PC6;
+		debug_led(TOGGLE);
 	}
 	
 	return 0;
 
 
 PROJECT=ImageAndWiFiFirmware
-HEADERS=
+HEADERS=util.h
 SOURCES=main.c
 CC=avr-gcc
 OBJCOPY=avr-objcopy