For more information, please refer to <http://unlicense.org/>
*/
-/* pigpio version 61 */
+/* pigpio version 62 */
/* include ------------------------------------------------------- */
SPI_CS_CSPOL(cspol) |
SPI_CS_CLEAR(3);
+ spiReg[SPI_DLEN] = 2; /* undocumented, stops inter-byte gap */
+
spiReg[SPI_CS] = spiDefaults; /* stop */
if (!count) return;
int serWrite(unsigned handle, char *buf, unsigned count)
{
+ int written=0, wrote=0;
+
DBG(DBG_USER, "handle=%d count=%d [%s]",
handle, count, myBuf2Str(count, buf));
if (!count)
SOFT_ERROR(PI_BAD_PARAM, "bad count (%d)", count);
- if (write(serInfo[handle].fd, buf, count) != count)
+ while ((written != count) && (wrote >= 0))
+ {
+ wrote = write(serInfo[handle].fd, buf+written, count-written);
+
+ if (wrote >= 0)
+ {
+ written += wrote;
+
+ if (written != count) time_sleep(0.05);
+ }
+ }
+
+ if (written != count)
return PI_SER_WRITE_FAILED;
else
return 0;
switchFunctionOff(gpio);
gpioInfo[gpio].is = GPIO_PWM;
+
+ if (!val) myGpioWrite(gpio, 0);
}
myGpioSetMode(gpio, PI_OUTPUT);
switchFunctionOff(gpio);
gpioInfo[gpio].is = GPIO_SERVO;
+
+ if (!val) myGpioWrite(gpio, 0);
}
myGpioSetMode(gpio, PI_OUTPUT);
For more information, please refer to <http://unlicense.org/>
*/
-/* PIGPIOD_IF_VERSION 25 */
+/* PIGPIOD_IF_VERSION 26 */
#include <stdio.h>
#include <stdlib.h>
int pigpio_start(char *addrStr, char *portStr)
{
+ if ((!addrStr) || (strlen(addrStr) == 0))
+ {
+ addrStr = "localhost";
+ }
+
if (!gPigStarted)
{
gPigCommand = pigpioOpenSocket(addrStr, portStr);
For more information, please refer to <http://unlicense.org/>
*/
-/* PIGPIOD_IF2_VERSION 9 */
+/* PIGPIOD_IF2_VERSION 10 */
#include <stdio.h>
#include <stdlib.h>
int pi;
int *userdata;
+ if ((!addrStr) || (strlen(addrStr) == 0))
+ {
+ addrStr = "localhost";
+ }
+
for (pi=0; pi<MAX_PI; pi++)
{
if (!gPiInUse[pi]) break;