Skip to content

Commit

Permalink
Fix Startup Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nimaltd committed May 16, 2017
1 parent 23f7747 commit 27e4332
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions ds18b20.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ void Task_Ds18b20(void const * argument)
uint8_t Ds18b20TryToFind=5;
do
{
osDelay(2000);
OneWire_Init(&OneWire,_DS18B20_GPIO ,_DS18B20_PIN);
osDelay(2000);
TempSensorCount = 0;
OneWireDevices = OneWire_First(&OneWire);
while (OneWireDevices)
{
osDelay(10);
osDelay(100);
TempSensorCount++;
OneWire_GetFullROM(&OneWire, ds18b20[TempSensorCount-1].Address);
OneWireDevices = OneWire_Next(&OneWire);
Expand Down
6 changes: 3 additions & 3 deletions onewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ void OneWire_Init(OneWire_t* OneWireStruct, GPIO_TypeDef* GPIOx, uint16_t GPIO_P
OneWireStruct->GPIO_Pin = GPIO_Pin;
ONEWIRE_OUTPUT(OneWireStruct);
ONEWIRE_HIGH(OneWireStruct);
osDelay(20);
osDelay(1000);
ONEWIRE_LOW(OneWireStruct);
osDelay(20);
osDelay(1000);
ONEWIRE_HIGH(OneWireStruct);
osDelay(20);
osDelay(2000);
}

uint8_t OneWire_Reset(OneWire_t* OneWireStruct) {
Expand Down

0 comments on commit 27e4332

Please sign in to comment.