Created
April 15, 2013 23:09
-
-
Save mokele/5392039 to your computer and use it in GitHub Desktop.
This file contains 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
27> [pie:gpio_init(Pin, input) || Pin <- Pins]. | |
["R15B03/lib/runtime_tools-1.8.9/ebin", | |
"R15B03/lib/runtime_tools-1.8.9/ebin", | |
"R15B03/lib/runtime_tools-1.8.9/ebin"] | |
static ERL_NIF_TERM | |
gpio_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) | |
{ | |
int pin, mode; | |
if (!enif_get_int(env, argv[0], &pin) || | |
!enif_get_int(env, argv[1], &mode)) | |
{ | |
return enif_make_badarg(env); | |
} | |
return gpio_init(pin, mode) == 1 ? atom_ok : error_failed_tuple; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment