Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jul 2015 09:25:23 +0000 (UTC)
From:      Christian Brueffer <brueffer@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284997 - head/lib/libgpio
Message-ID:  <201507010925.t619PNnb002920@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brueffer
Date: Wed Jul  1 09:25:23 2015
New Revision: 284997
URL: https://svnweb.freebsd.org/changeset/base/284997

Log:
  Make the example code actually work.
  
  PR:		199440
  Submitted by:	waitman@waitman.net
  Reviewed by:	loos
  MFC after:	1 week

Modified:
  head/lib/libgpio/gpio.3

Modified: head/lib/libgpio/gpio.3
==============================================================================
--- head/lib/libgpio/gpio.3	Wed Jul  1 08:48:49 2015	(r284996)
+++ head/lib/libgpio/gpio.3	Wed Jul  1 09:25:23 2015	(r284997)
@@ -35,6 +35,7 @@
 .Sh LIBRARY
 .Lb libgpio
 .Sh SYNOPSIS
+.In sys/types.h
 .In libgpio.h
 .Ft "gpio_handle_t"
 .Fn gpio_open "unsigned int unit"
@@ -161,13 +162,14 @@ are wrappers around
 The following example shows how to configure pin 16 as output and then
 drive it high:
 .Bd -literal
+#include <sys/types.h>
 #include <err.h>
 #include <libgpio.h>
 
 gpio_handle_t handle;
 
 handle = gpio_open(0);
-if (handle == GPIO_HANDLE_INVALID)
+if (handle == GPIO_INVALID_HANDLE)
 	err(1, "gpio_open failed");
 gpio_pin_output(handle, 16);
 gpio_pin_high(handle, 16);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507010925.t619PNnb002920>