File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,17 @@ void DS1820_OnEverySecond()
426
426
427
427
if (g_secondsElapsed % ds18_conversionPeriod == 0 || lastconv == 0 ) //dsread == 0
428
428
{
429
+ if (ds18_family == 0 )
430
+ {
431
+ int discovered = DS1820_DiscoverFamily ();
432
+ if (!discovered )
433
+ {
434
+ lastconv = -1 ; // reset lastconv to avoid immediate retry
435
+ DS1820_LOG (ERROR , "Family not discovered" );
436
+ return ;
437
+ }
438
+ }
439
+
429
440
if (OWReset (Pin ) == 0 )
430
441
{
431
442
lastconv = -1 ; // reset lastconv to avoid immediate retry
@@ -458,17 +469,6 @@ void DS1820_OnEverySecond()
458
469
return ;
459
470
}
460
471
461
- if (ds18_family == 0 )
462
- {
463
- int discovered = DS1820_DiscoverFamily ();
464
- if (!discovered )
465
- {
466
- lastconv = -1 ; // reset lastconv to avoid immediate retry
467
- DS1820_LOG (ERROR , "Family not discovered" );
468
- return ;
469
- }
470
- }
471
-
472
472
DS1820_LOG (INFO , "Starting conversion" );
473
473
OWWriteByte (Pin , SKIP_ROM );
474
474
OWWriteByte (Pin , CONVERT_T );
You can’t perform that action at this time.
0 commit comments