Skip to content

Commit bdf2c8e

Browse files
Merge pull request #9 from Darlington49/master
Update Pin_Mode
2 parents 64c5599 + eeb82bf commit bdf2c8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tutorial 25 - DHT22 Temperature Sensor/MY_DHT22.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void DHT22_Init(GPIO_TypeDef* DataPort, uint16_t DataPin)
5151
static void ONE_WIRE_PinMode(OnePinMode_Typedef mode)
5252
{
5353
GPIO_InitTypeDef GPIO_InitStruct;
54-
GPIO_InitStruct.Pin = GPIO_PIN_9;
54+
GPIO_InitStruct.Pin = oneWire_PIN;
5555
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
5656
GPIO_InitStruct.Pull = GPIO_NOPULL;
5757

@@ -67,7 +67,7 @@ static void ONE_WIRE_PinMode(OnePinMode_Typedef mode)
6767
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
6868
}
6969

70-
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
70+
HAL_GPIO_Init(oneWire_PORT, &GPIO_InitStruct);
7171
}
7272
//One Wire pin HIGH/LOW Write
7373
static void ONE_WIRE_Pin_Write(bool state)

0 commit comments

Comments
 (0)