# HG changeset patch # User Daniel O'Connor # Date 1328659586 -37800 # Node ID a50a054d060c61aa4d6351c0377871cd10b004a9 # Parent d8002c716678d8faa390c8fb1bff27ecaa73bdcb - Make OWREADBUS work properly. - Fix debug commands. diff -r d8002c716678 -r a50a054d060c 1wire-config-stm32.h --- a/1wire-config-stm32.h Wed Feb 08 10:35:13 2012 +1030 +++ b/1wire-config-stm32.h Wed Feb 08 10:36:26 2012 +1030 @@ -37,7 +37,7 @@ #include "stm32f10x.h" /* GPIO* */ #include "hw.h" /* For _usleep16() */ -/* No need for this on ARM */ +/* Fudge AVR stuff for ARM */ #define PROGMEM #define PSTR(x) x #define pgm_read_byte(x) *(x) @@ -48,6 +48,7 @@ /* Set the port up to allow reading from the 1 wire bus */ #define OWSETREAD() do { \ GPIO_InitTypeDef GPIO_InitStructure; \ + \ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3; \ GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; \ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; \ @@ -56,7 +57,7 @@ /* Read the 1-wire bus, non-inverting logic */ -#define OWREADBUS() (GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_3)) +#define OWREADBUS() (GPIO_ReadInputDataBit(GPIOE, GPIO_Pin_3) ? 1 : 0) /* Set the 1-wire bus to 0 */ @@ -89,11 +90,12 @@ #define OWDELAY_G /* 0 usec */ #define OWDELAY_H _usleep16(480) /* 480 usec */ #define OWDELAY_I _usleep16(70) /* 70 usec */ +#define OWDELAY_J _usleep16(410) /* 410 usec */ #ifdef OW_DEBUG -#define OWPUTS(x) puts_P(x) -#define OWPUTSP(x) puts_P(x) -#define OWPRINTFP(fmt, ...) printf_P(fmt, ## __VA_ARGS__) +#define OWPUTS(x) puts(x) +#define OWPUTSP(x) puts(x) +#define OWPRINTFP(fmt, ...) printf(fmt, ## __VA_ARGS__) #else #define OWPUTS(x) #define OWPUTSP(x)