From owner-freebsd-embedded@FreeBSD.ORG Thu Sep 5 22:42:50 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4B9F2C1E for ; Thu, 5 Sep 2013 22:42:50 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-f178.google.com (mail-ie0-f178.google.com [209.85.223.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C07925A4 for ; Thu, 5 Sep 2013 22:42:49 +0000 (UTC) Received: by mail-ie0-f178.google.com with SMTP id f4so5375733iea.9 for ; Thu, 05 Sep 2013 15:42:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=Q2QmzUEQU3YNYpGxMa/5WX6IKTsl/GDj9B5aUddOwrA=; b=PT/u4PsHOhA3ej+nc0V5X0xvDVJuKMJmITqPGN/yBUqDfeWwdnKC7JDi1hqJgoPF8d 3KAxbujnTUkGweQD9ir4EY9ejJXYCso4YOi0ASFm4r2OgWgv97CTmp5/+BGedcxXyHFg Rxnt816VPWqP6fhhdC5QYOmYP31OzF7bv7f1XGHEW69KFgE3jp/tdfdyyDJokOyZI3eV c1TpTd1kpD/4knQfPYrUkrtN1M+8qgXoIwINx4N0MJdJcboqyQslKNxDe0GkQJJsRDV/ aP8XHsrXWU6Sat/8d+d7Sv8i5BF4l4csA1kulda2lYaCu5KqbIcbJomwV7IbkeY5u5uY hH1A== X-Gm-Message-State: ALoCoQm7/J32+SEB+BSCNGE2WzNMd0rpEYU/Dngp/zMyoa4kJaxmMD7c0X9+Q6W3p9XEyPsz9Bx8 X-Received: by 10.43.172.2 with SMTP id nw2mr7021530icc.9.1378420969190; Thu, 05 Sep 2013 15:42:49 -0700 (PDT) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id yt10sm14103653igb.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Sep 2013 15:42:48 -0700 (PDT) Sender: Warner Losh Subject: Re: off by one error, maxpins Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <1378420702.1647.18.camel@localhost> Date: Thu, 5 Sep 2013 16:42:44 -0600 Content-Transfer-Encoding: 7bit Message-Id: References: <1378420702.1647.18.camel@localhost> To: sbruno@freebsd.org X-Mailer: Apple Mail (2.1085) Cc: freebsd-embedded X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2013 22:42:50 -0000 Shouldn't npins and/or maxpin just be bumped by 1 instead? Warner On Sep 5, 2013, at 4:38 PM, Sean Bruno wrote: > http://people.freebsd.org/~sbruno/maxpin_plus_one.txt > > Been screwing around with pins and led's on the DIR-825 B1. Looks like > it has an led on PIN 11, its "maxpin" is 11 when its setup at > initialization. This is causing the *last* gpio pin to be ignored. > > e.g. > --original-- > # gpioctl -f /dev/gpioc0 -l > > pin 00: 0 pin 0 > pin 01: 0 pin 1 > pin 02: 0 pin 2 > pin 03: 1 pin 3 > pin 04: 0 pin 4 > pin 05: 1 pin 5 > pin 06: 0 pin 6 > pin 07: 1 pin 7 > pin 08: 0 pin 8 > > > --patch-- > # gpioctl -f /dev/gpioc0 -l > pin 00: 0 pin 0 > pin 01: 0 pin 1 > pin 02: 0 pin 2 > pin 03: 1 pin 3 > pin 04: 0 pin 4 > pin 05: 1 pin 5 > pin 06: 0 pin 6 > pin 07: 1 pin 7 > pin 08: 0 pin 8 > pin 11: 0 pin 11 >