diff main.c @ 16:db6011aa94d6

Use new delay routine on pin 2 so it doesn't interfere with 1 wire.
author Daniel O'Connor <darius@dons.net.au>
date Wed, 14 Nov 2012 12:30:05 +1030
parents 96c345d304af
children d078651f5353
line wrap: on
line diff
--- a/main.c	Wed Nov 14 12:24:44 2012 +1030
+++ b/main.c	Wed Nov 14 12:30:05 2012 +1030
@@ -238,11 +238,18 @@
 		c = lcd_parsecol(col);
 		lcd_line(x, y, x1, y1, c);
 	    } else if (!strncmp("delay", cmd.buf, 5)) {
+		GPIO_InitTypeDef GPIO_InitStructure;
+		
+		GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
+		GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
+		GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
+		GPIO_Init(GPIOE, &GPIO_InitStructure);
+
 		for (x = 0; x < 100; x++) {
-		    GPIO_SetBits(GPIOE, GPIO_Pin_3);
-		    _usleep16(30000);
-		    GPIO_ResetBits(GPIOE, GPIO_Pin_3);
-		    _usleep16(60000);
+		    GPIO_SetBits(GPIOE, GPIO_Pin_2);
+		    delay(30);
+		    GPIO_ResetBits(GPIOE, GPIO_Pin_2);
+		    delay(60);
 		}
 	    } else if (!strncmp("rs", cmd.buf, 2)) {
 		printf("Reset got %d\r\n", OWTouchReset());