Mercurial > ~darius > hgwebdir.cgi > stm32temp
diff 1wire-config.h @ 38:38869c474104
Remove kludgy delays.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Mon, 01 Apr 2013 19:45:19 +1030 |
parents | b12881051261 |
children | 345a42f6151b |
line wrap: on
line diff
--- a/1wire-config.h Mon Apr 01 19:44:47 2013 +1030 +++ b/1wire-config.h Mon Apr 01 19:45:19 2013 +1030 @@ -81,9 +81,8 @@ GPIO_Init(GPIOE, &GPIO_InitStructure); \ } while (0) -#if 0 #define OWDELAY_A delay(6) /* 6 usec */ -#define OWDELAY_B delay(64) /* 64 usec */ +#define OWDELAY_B delay(65) /* 64 usec */ #define OWDELAY_C delay(60) /* 60 usec */ #define OWDELAY_D delay(10) /* 10 usec */ #define OWDELAY_E delay(9) /* 9 usec */ @@ -92,23 +91,7 @@ #define OWDELAY_H delay(480) /* 480 usec */ #define OWDELAY_I delay(70) /* 70 usec */ #define OWDELAY_J delay(410) /* 410 usec */ -#else -/* As measured by the cro delay() is correct, but the code does not work and I don't understand why. - * We need to use delays 2/3 the expected amount. - * Possibly due to use of GPIO_Init(), however the STM32 lib doesn't seem to have a function to - * just set the GPIO mode. - */ -#define OWDELAY_A delay(4) /* 6 usec */ -#define OWDELAY_B delay(43) /* 64 usec */ -#define OWDELAY_C delay(40) /* 60 usec */ -#define OWDELAY_D delay(7) /* 10 usec */ -#define OWDELAY_E delay(6) /* 9 usec */ -#define OWDELAY_F delay(37) /* 55 usec */ -#define OWDELAY_G /* 0 usec */ -#define OWDELAY_H delay(320) /* 480 usec */ -#define OWDELAY_I delay(47) /* 70 usec */ -#define OWDELAY_J delay(273) /* 410 usec */ -#endif + //#define OW_DEBUG #ifdef OW_DEBUG #define OWPUTS(x) puts(x)