mirror of
https://github.com/clockworkpi/WiringPi.git
synced 2026-06-13 22:33:11 +02:00
Many changes - tidying up the extensions interfaces.
Updating the GPIO command - new command - allreadall ScrollPhat code max31855 code (tested with adafruit breakout board) more tests updated rht03 code Raspberry Pi v3 support.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* drcSerial.c:
|
||||
* Extend wiringPi with the DRC Serial protocol (e.g. to Arduino)
|
||||
* Copyright (c) 2013 Gordon Henderson
|
||||
* Copyright (c) 2013-2016 Gordon Henderson
|
||||
***********************************************************************
|
||||
* This file is part of wiringPi:
|
||||
* https://projects.drogon.net/raspberry-pi/wiringpi/
|
||||
@@ -32,11 +32,6 @@
|
||||
|
||||
#include "drcSerial.h"
|
||||
|
||||
#ifndef TRUE
|
||||
# define TRUE (1==1)
|
||||
# define FALSE (1==2)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* myPinMode:
|
||||
@@ -156,7 +151,7 @@ int drcSetupSerial (const int pinBase, const int numPins, const char *device, co
|
||||
struct wiringPiNodeStruct *node ;
|
||||
|
||||
if ((fd = serialOpen (device, baud)) < 0)
|
||||
return wiringPiFailure (WPI_ALMOST, "Unable to open DRC device (%s): %s", device, strerror (errno)) ;
|
||||
return FALSE ;
|
||||
|
||||
delay (10) ; // May need longer if it's an Uno that reboots on the open...
|
||||
|
||||
@@ -184,7 +179,7 @@ int drcSetupSerial (const int pinBase, const int numPins, const char *device, co
|
||||
if (!ok)
|
||||
{
|
||||
serialClose (fd) ;
|
||||
return wiringPiFailure (WPI_FATAL, "Unable to communicate with DRC serial device") ;
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
node = wiringPiNewNode (pinBase, numPins) ;
|
||||
@@ -197,5 +192,5 @@ int drcSetupSerial (const int pinBase, const int numPins, const char *device, co
|
||||
node->digitalWrite = myDigitalWrite ;
|
||||
node->pwmWrite = myPwmWrite ;
|
||||
|
||||
return 0 ;
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user