# HG changeset patch # User Daniel O'Connor # Date 1352858405 -37800 # Node ID db6011aa94d6bbd9eec2bf349304edce6bfb8943 # Parent b12881051261ed8dfc1efe32bdd6476a8b9bbe3c Use new delay routine on pin 2 so it doesn't interfere with 1 wire. diff -r b12881051261 -r db6011aa94d6 main.c --- 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());