esp-idf-hal
esp-idf-hal copied to clipboard
Next
I've been following this branch with my project and right now the only issue I am having is that when calling .into_output() or .into_input() on a new ("disabled") PinDriver, the original PinDriver (the "disabled" one), gets dropped AFTER the pin is configured to input/output. The result is that the pin is reset to input w/ pull-up during drop() of the "disabled" PinDriver.
I've even run the blinky example and seen that this was the case.
I've been following this branch with my project and right now the only issue I am having is that when calling
.into_output()or.into_input()on a new ("disabled")PinDriver, the originalPinDriver(the "disabled" one), gets dropped AFTER the pin is configured to input/output. The result is that the pin is reset to input w/ pull-up duringdrop()of the "disabled"PinDriver.I've even run the blinky example and seen that this was the case.
Good point! Let me look into this.
I've been following this branch with my project and right now the only issue I am having is that when calling
.into_output()or.into_input()on a new ("disabled")PinDriver, the originalPinDriver(the "disabled" one), gets dropped AFTER the pin is configured to input/output. The result is that the pin is reset to input w/ pull-up duringdrop()of the "disabled"PinDriver. I've even run the blinky example and seen that this was the case.Good point! Let me look into this.
I think I fixed this now. Also, I've implemented PinDriver constructors that put the pin directly into the desired state. E.g. you can now use PinDriver::input(...)? instead of doing the PinDriver::new(...)?.into_input()? weird dance.
PinDriver::new is therefore now retired as well.
I've been following this branch with my project and right now the only issue I am having is that when calling
.into_output()or.into_input()on a new ("disabled")PinDriver, the originalPinDriver(the "disabled" one), gets dropped AFTER the pin is configured to input/output. The result is that the pin is reset to input w/ pull-up duringdrop()of the "disabled"PinDriver. I've even run the blinky example and seen that this was the case.Good point! Let me look into this.
I think I fixed this now. Also, I've implemented
PinDriverconstructors that put the pin directly into the desired state. E.g. you can now usePinDriver::input(...)?instead of doing thePinDriver::new(...)?.into_input()?weird dance.
PinDriver::newis therefore now retired as well.
I tested your changes and they work correctly. Thanks!