Closed donni-h closed 1 year ago
I noticed this as well with the esp8266 nodeMCU board. It looks like the dht
driver uses machine.UART1, but the esp boards only defines a UART0. Is there something special about UART1
vs UART0
?
Should the dht
driver be referring to the machine.DefaultUART package variable instead of a specific UART#
directly? Though looks like the UART type defined in the machine_espXXX.go
files doesn't include the Interrupt
member used by the dht
driver.
That's a bug in the driver. Instead of using UART1.Disable()
etc it should use mask := interrupt.Disable()
and interrupt.Restore(mask)
(from runtime/interrupt)
Feel free to send a PR to fix this issue.
Hey folks, so I was trying to hook up a DHT22 to my ESP32 Dev Module with the following basic code:
whatever I did calling
dht.New(machine.SDA_PIN, dht.DHT22)
caused tinygo to fail flashing with the error>machine.UART1.Interrupt undefined (type *machine.UART has no field or method Interrupt)
. Is this a bug, since I've been told that ESP support in tinygo is not quite perfect yet, or is it an issue on my end?