Fixing command line arguments for new option -m
authorTheRaspyDev <theraspydev@gmail.com>
Fri, 19 May 2017 08:01:51 +0000 (10:01 +0200)
committerTheRaspyDev <theraspydev@gmail.com>
Fri, 19 May 2017 08:01:51 +0000 (10:01 +0200)
command.c
pigpio.3
pigpio.c
pigpio.h
pigpio.py
pigpiod.c

index 82e1c7458641e242c8b503caee779a00c19cb668..573f59fb728fa0cc43271f296fd44ce6daa29122 100644 (file)
--- a/command.c
+++ b/command.c
@@ -442,7 +442,7 @@ static errInfo_t errInfo[]=
    {PI_BAD_PATHNAME     , "can't open pathname"},
    {PI_NO_HANDLE        , "no handle available"},
    {PI_BAD_HANDLE       , "unknown handle"},
-   {PI_BAD_IF_FLAGS     , "ifFlags > 3"},
+   {PI_BAD_IF_FLAGS     , "ifFlags > 4"},
    {PI_BAD_CHANNEL      , "DMA channel not 0-14"},
    {PI_BAD_SOCKET_PORT  , "socket port not 1024-30000"},
    {PI_BAD_FIFO_COMMAND , "unknown fifo command"},
index e33dde619de363257dc738902a2bf69318213b9d..b866a987e422ff7a2fa2e01a8bfa1f8f999fcb1f 100644 (file)
--- a/pigpio.3
+++ b/pigpio.3
@@ -9796,7 +9796,7 @@ A 16-bit word value.
 .br
 #define PI_BAD_HANDLE       -25 // unknown handle
 .br
-#define PI_BAD_IF_FLAGS     -26 // ifFlags > 3
+#define PI_BAD_IF_FLAGS     -26 // ifFlags > 4
 .br
 #define PI_BAD_CHANNEL      -27 // DMA channel not 0-14
 .br
index fac0daa701d04e05d96f96a4bb2358b907de3309..7e34f444fb6365b5a186d3aa52390755c1f88b1d 100644 (file)
--- a/pigpio.c
+++ b/pigpio.c
@@ -13328,7 +13328,7 @@ int gpioCfgInterfaces(unsigned ifFlags)
 
    CHECK_NOT_INITED;
 
-   if (ifFlags > 7)
+   if (ifFlags > 15)
       SOFT_ERROR(PI_BAD_IF_FLAGS, "bad ifFlags (%X)", ifFlags);
 
    gpioCfg.ifFlags = ifFlags;
index cb1d76d06564716d0d0c8c2e73a77e3d62ca1412..b8a95bbbfa4f3151b4a9bfcc4c7f48fa0508dc79 100644 (file)
--- a/pigpio.h
+++ b/pigpio.h
@@ -6143,7 +6143,7 @@ after this command is issued.
 #define PI_BAD_PATHNAME     -23 // can't open pathname
 #define PI_NO_HANDLE        -24 // no handle available
 #define PI_BAD_HANDLE       -25 // unknown handle
-#define PI_BAD_IF_FLAGS     -26 // ifFlags > 3
+#define PI_BAD_IF_FLAGS     -26 // ifFlags > 4
 #define PI_BAD_CHANNEL      -27 // DMA channel not 0-14
 #define PI_BAD_PRIM_CHANNEL -27 // DMA primary channel not 0-14
 #define PI_BAD_SOCKET_PORT  -28 // socket port not 1024-32000
index 517943f8eba085ee727712ca963824d82d7b4865..bf45e05c1f8b0023a17b0da69c6cd4c3e053fe63 100644 (file)
--- a/pigpio.py
+++ b/pigpio.py
@@ -712,7 +712,7 @@ _errors=[
    [_PI_BAD_PATHNAME     , "can't open pathname"],
    [PI_NO_HANDLE         , "no handle available"],
    [PI_BAD_HANDLE        , "unknown handle"],
-   [_PI_BAD_IF_FLAGS     , "ifFlags > 3"],
+   [_PI_BAD_IF_FLAGS     , "ifFlags > 4"],
    [_PI_BAD_CHANNEL      , "DMA channel not 0-14"],
    [_PI_BAD_SOCKET_PORT  , "socket port not 1024-30000"],
    [_PI_BAD_FIFO_COMMAND , "unknown fifo command"],
index 8323380775370eddca13b59f15cd530a5c7645dd..d680b3b819422d881108eb15f26bda88944f6b49 100644 (file)
--- a/pigpiod.c
+++ b/pigpiod.c
@@ -103,6 +103,7 @@ void usage()
       "   -k,         disable socket interface,          default enabled\n" \
       "   -l,         localhost socket only              default local+remote\n" \
       "   -n IP addr, allow address, name or dotted,     default allow all\n" \
+      "   -m,         disable alerts                     default enabled\n" \
       "   -p value,   socket port, 1024-32000,           default 8888\n" \
       "   -s value,   sample rate, 1, 2, 4, 5, 8, or 10, default 5\n" \
       "   -t value,   clock peripheral, 0=PWM 1=PCM,     default PCM\n" \
@@ -162,7 +163,7 @@ static void initOpts(int argc, char *argv[])
    uint32_t addr;
    int64_t mask;
 
-   while ((opt = getopt(argc, argv, "a:b:c:d:e:fgkln:p:s:t:x:vV")) != -1)
+   while ((opt = getopt(argc, argv, "a:b:c:d:e:fgkln:mp:s:t:x:vV")) != -1)
    {
       switch (opt)
       {