summaryrefslogtreecommitdiff
path: root/lib/lua
diff options
context:
space:
mode:
authormbalmer <mbalmer@NetBSD.org>2011-11-13 09:46:11 +0000
committermbalmer <mbalmer@NetBSD.org>2011-11-13 09:46:11 +0000
commitc16623ecaaaf89c4a2f15949fe25b48945035189 (patch)
tree897100726199477c55f85ed1c2a4c81f0b365627 /lib/lua
parentaadd9ae3030aacaedb2d5bc767e8615f3e814109 (diff)
Start numbering pions with 0, not 1. Ruined a demo, so it was a bad idea.
Diffstat (limited to 'lib/lua')
-rw-r--r--lib/lua/gpio/gpio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lua/gpio/gpio.c b/lib/lua/gpio/gpio.c
index 27ba7693677..85cca0ebfd1 100644
--- a/lib/lua/gpio/gpio.c
+++ b/lib/lua/gpio/gpio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gpio.c,v 1.3 2011/10/10 20:41:05 christos Exp $ */
+/* $NetBSD: gpio.c,v 1.4 2011/11/13 09:46:11 mbalmer Exp $ */
/*
* Copyright (c) 2011 Marc Balmer <marc@msys.ch>
@@ -112,7 +112,7 @@ gpio_get_pin(lua_State *L, int n, struct gpio_req *req)
{
switch (lua_type(L, n)) {
case LUA_TNUMBER:
- req->gp_pin = (int)lua_tointeger(L, n) - 1; /* 1 based! */
+ req->gp_pin = (int)lua_tointeger(L, n); /* not 1 based! */
break;
case LUA_TSTRING:
strlcpy(req->gp_name, lua_tostring(L, n), sizeof(req->gp_name));