Browse Source

Debugging firmware

Thomas Buck 13 years ago
parent
commit
2bbfbc440a
2 changed files with 15 additions and 4 deletions
  1. 4
    0
      Cube Firmware/cube.h
  2. 11
    4
      Cube Firmware/main.c

+ 4
- 0
Cube Firmware/cube.h View File

36
 extern void setImage(uint8_t **img); // img[8][8]
36
 extern void setImage(uint8_t **img); // img[8][8]
37
 extern uint8_t isFinished(void);
37
 extern uint8_t isFinished(void);
38
 extern void close(void);
38
 extern void close(void);
39
+
40
+// For debugging, not normal operation:
41
+extern void setFet(uint8_t data);
42
+extern void setLatch(uint8_t latchNr, uint8_t data);

+ 11
- 4
Cube Firmware/main.c View File

32
 #endif
32
 #endif
33
 
33
 
34
 int main(void) {
34
 int main(void) {
35
-	
36
-	init(); // Initialize Cube Low-Level Code
35
+	uint8_t i;
36
+
37
+	// init(); // Initialize Cube Low-Level Code
37
 	uart_init(UART_BAUD_SELECT(19200, 16000000L)); // Initialize Serial
38
 	uart_init(UART_BAUD_SELECT(19200, 16000000L)); // Initialize Serial
38
 
39
 
39
 	// Blink led :)
40
 	// Blink led :)
40
 	while (1) {
41
 	while (1) {
41
-		PORTB |= (1 << PB0);
42
+		/* PORTB |= (1 << PB0);
42
 		_delay_ms(1000);
43
 		_delay_ms(1000);
43
 		PORTB &= ~(1 << PB0);
44
 		PORTB &= ~(1 << PB0);
44
-		_delay_ms(1000);
45
+		_delay_ms(1000); */
46
+		for (i = 0; i < 8; i++) {
47
+			setFet(1 << i);
48
+			_delay_ms(500);
49
+		}
50
+		setFet(0);
51
+		_delay_ms(10000);
45
 	}
52
 	}
46
 
53
 
47
 	close();
54
 	close();

Loading…
Cancel
Save