Last active
August 29, 2015 13:56
-
-
Save cceckman/9245947 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use self::arm1176jzf_s::gpio::pin_mode::OUTPUT; | |
| // Compilation error: cannot import from a trait or type implementation | |
| pub mod arm1176jzf_s; | |
| // Defined with submodules in separate file | |
| pub fn init() { | |
| let p : Pin = arm1176jzf_s::gpio::Pin::get(16); | |
| p.setMode(OUTPUT); | |
| // setMode has a single parameter of type arm1176jzf_s::gpio::pin_mode; OUTPUT is a variant thereof | |
| // Even with "use" above removed, this gives an error- rustc doesn't recognize the name OUTPUT | |
| p.write(p, false); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resolution: OUTPUT is in the gpio namespace, not a pin_mode namespace. So
use self::arm1176jzf_s::gpiolets us then refer togpio::OUTPUTunambiguously.