Date: Thu, 5 Sep 2013 16:42:44 -0600 From: Warner Losh <imp@bsdimp.com> To: sbruno@freebsd.org Cc: freebsd-embedded <freebsd-embedded@freebsd.org> Subject: Re: off by one error, maxpins Message-ID: <FA19C2B0-8128-4A30-AF38-DDFD7F41AE82@bsdimp.com> In-Reply-To: <1378420702.1647.18.camel@localhost> References: <1378420702.1647.18.camel@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
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<OUT> > pin 01: 0 pin 1<OUT> > pin 02: 0 pin 2<OUT> > pin 03: 1 pin 3<OUT> > pin 04: 0 pin 4<OUT> > pin 05: 1 pin 5<IN> > pin 06: 0 pin 6<OUT> > pin 07: 1 pin 7<IN> > pin 08: 0 pin 8<OUT> > > > --patch-- > # gpioctl -f /dev/gpioc0 -l > pin 00: 0 pin 0<OUT> > pin 01: 0 pin 1<OUT> > pin 02: 0 pin 2<OUT> > pin 03: 1 pin 3<OUT> > pin 04: 0 pin 4<OUT> > pin 05: 1 pin 5<IN> > pin 06: 0 pin 6<OUT> > pin 07: 1 pin 7<IN> > pin 08: 0 pin 8<OUT> > pin 11: 0 pin 11<OUT> >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FA19C2B0-8128-4A30-AF38-DDFD7F41AE82>