File tree 1 file changed +7
-2
lines changed 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 32
32
#include "extmod/machine_pulse.h"
33
33
#include "drivers/dht/dht.h"
34
34
35
+ // Allow the open-drain-high call to be DHT specific for ports that need it
36
+ #ifndef mp_hal_pin_od_high_dht
37
+ #define mp_hal_pin_od_high_dht mp_hal_pin_od_high
38
+ #endif
39
+
35
40
STATIC mp_obj_t dht_readinto (mp_obj_t pin_in , mp_obj_t buf_in ) {
36
41
mp_hal_pin_obj_t pin = mp_hal_get_pin_obj (pin_in );
37
42
mp_hal_pin_open_drain (pin );
@@ -44,15 +49,15 @@ STATIC mp_obj_t dht_readinto(mp_obj_t pin_in, mp_obj_t buf_in) {
44
49
}
45
50
46
51
// issue start command
47
- mp_hal_pin_od_high (pin );
52
+ mp_hal_pin_od_high_dht (pin );
48
53
mp_hal_delay_ms (250 );
49
54
mp_hal_pin_od_low (pin );
50
55
mp_hal_delay_ms (18 );
51
56
52
57
mp_uint_t irq_state = mp_hal_quiet_timing_enter ();
53
58
54
59
// release the line so the device can respond
55
- mp_hal_pin_od_high (pin );
60
+ mp_hal_pin_od_high_dht (pin );
56
61
mp_hal_delay_us_fast (10 );
57
62
58
63
// wait for device to respond
You can’t perform that action at this time.
0 commit comments