Mercurial > ~darius > hgwebdir.cgi > stm32temp
comparison 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 |
comparison
equal
deleted
inserted
replaced
15:b12881051261 | 16:db6011aa94d6 |
---|---|
236 } | 236 } |
237 | 237 |
238 c = lcd_parsecol(col); | 238 c = lcd_parsecol(col); |
239 lcd_line(x, y, x1, y1, c); | 239 lcd_line(x, y, x1, y1, c); |
240 } else if (!strncmp("delay", cmd.buf, 5)) { | 240 } else if (!strncmp("delay", cmd.buf, 5)) { |
241 GPIO_InitTypeDef GPIO_InitStructure; | |
242 | |
243 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; | |
244 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; | |
245 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; | |
246 GPIO_Init(GPIOE, &GPIO_InitStructure); | |
247 | |
241 for (x = 0; x < 100; x++) { | 248 for (x = 0; x < 100; x++) { |
242 GPIO_SetBits(GPIOE, GPIO_Pin_3); | 249 GPIO_SetBits(GPIOE, GPIO_Pin_2); |
243 _usleep16(30000); | 250 delay(30); |
244 GPIO_ResetBits(GPIOE, GPIO_Pin_3); | 251 GPIO_ResetBits(GPIOE, GPIO_Pin_2); |
245 _usleep16(60000); | 252 delay(60); |
246 } | 253 } |
247 } else if (!strncmp("rs", cmd.buf, 2)) { | 254 } else if (!strncmp("rs", cmd.buf, 2)) { |
248 printf("Reset got %d\r\n", OWTouchReset()); | 255 printf("Reset got %d\r\n", OWTouchReset()); |
249 } else if (!strncmp("sr", cmd.buf, 2)) { | 256 } else if (!strncmp("sr", cmd.buf, 2)) { |
250 uint8_t ROM[8]; | 257 uint8_t ROM[8]; |