Skip to content

Instantly share code, notes, and snippets.

@mokele
Created April 15, 2013 23:09
Show Gist options
  • Save mokele/5392039 to your computer and use it in GitHub Desktop.
Save mokele/5392039 to your computer and use it in GitHub Desktop.
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