From 7154e302e3749b54615a70548ba3be2cc04b0c2d Mon Sep 17 00:00:00 2001 From: joan2937 Date: Sun, 16 Aug 2020 21:27:04 +0100 Subject: [PATCH] New pulse per second example synced to wall time. --- DOC/dbase/pigpio.sqlite | Bin 1433600 -> 1433600 bytes DOC/src/defs/examples.def | 5 ++++- pigpio.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/DOC/dbase/pigpio.sqlite b/DOC/dbase/pigpio.sqlite index c20cbe090d34969f2b040eb9589c6e89e524fba0..f24fd30acb732b2cd3b9676e570ebb7a00e94642 100644 GIT binary patch delta 843 zcmZvY!A}!G6vlU!?G{Sg-4=@mTb(x6sG;rB8pKcvkps~fDS`q6O9h zmBG2gAW(F7I|4+o^NWoj2+|%Q>_vN|+`_)Kl_U1bt1=6JKE=V#&QcPQNtbYeyf_-vD~~h<0lbf*wE-1h}z0 zM^jy86a3AnI<4wvRj*a`I#su*dcCS!Ro$lQc2&n!_KEJWkc1Ukb;lGUcN~87LU;7G z5)F80C&qzcF$~6zsV;K> zAgm=TbQ^hkJgW!^NstqYkP>t0#Hf%HWIiv-zF0J*NPI39uS#HCkYT?efupGMi9S*z zNebHeOgC%uTXe0B0`YNW@8RJQ@SG`iZq%b09yC^s=+pdh@RdRLd2k51M?hUQdAYQ@ z7SaZ~z!HO~IPflWE|Midzvkz#wzRP3t*Wk+R<|#d#g!sM2e`9=a0_YT%f zCTlL@jS?xmHxI{T;bw;~C8mXtkqk~{B;S9W_-9r$#K)pZITq%^T!1?h2)7wy-pz|} z-%tVaP%@kpbNJX3Ki><5JAzz*lW@;^1)gY$c1%V)TDg-!2nWW5{f3MJl|n8hq~Sy+ zKL+!-Fu`ZDFrT?C?DxW?IG#)Mav@lq!m<}a`BLwPjK;XY4-0y4Gc%7HfV1l9b+l*# p8>n&|ShaQ^_-IC(Hgi*H=hvq8=M(@Yq`N>&JI8_ucvf+-e*rvu1gii5 delta 567 zcmXYt&1(};6vgLFl8O14uOzpMCO9dgE{b1q5fEiW!Htw!t%*`eViqFRW}p?c8$&J6 zETkp~-h~SV7j@YX+Xo^vSSkjrRB<6#nfD)MjJh1DlHqeQtvd6@DYlt(C!QXZo` zPPt0CM!8P8@syiUnOws-H)jUPs3eh#f-%8mK|xRyToGIqjN>bAjw)nC%olKun+GCs u(ddnkr^E$cw1;xv6eI-6j$z3*3m$=g`pbY-UXWja(Fs_@Vu20#tN#Z@J*~+A diff --git a/DOC/src/defs/examples.def b/DOC/src/defs/examples.def index 5a54f92..637a82b 100644 --- a/DOC/src/defs/examples.def +++ b/DOC/src/defs/examples.def @@ -52,7 +52,7 @@ Examples of C pigpio programs. If your program is called foobar.c then build with -gcc -Wall -pthread -o foobar foobar.c -lpigpio -lrt +gcc -Wall -o foobar foobar.c -lpigpio ?3|freq_count_1|2014-08-20|Frequency Counter 1 A program showing how to use the gpioSetAlertFunc function to set a callback for GPIO state changes. A frequency count is generated for each monitored GPIO (frequencies up to 500kHz with a sample rate of 1μs). @@ -75,6 +75,9 @@ A program to display readings from the (I2C) PCF8591. ?3|pot_cap_charge_c|2014-03-14|Pot + Capacitor Recharge Timing Function to time capacitor charging (through a resistance). The time can be used to estimate the resistance. +?3|pps_c|2020-07-28|Pulse Per Second generator +A program to generate a pulse on a GPIO every x seconds (1<=x<=60). The pulse is synced with the wall time second boundary. + ?3|rotary_encoder_c|2015-10-03|Rotary Encoder Function to decode a mechanical rotary encoder. diff --git a/pigpio.c b/pigpio.c index ff1fb5d..eb04fcd 100644 --- a/pigpio.c +++ b/pigpio.c @@ -13221,6 +13221,8 @@ int fileApprove(char *filename) buffer[0] = 0; match[0] = 0; + if (myPathBad(filename)) return PI_FILE_NONE; + f = fopen("/opt/pigpio/access", "r"); if (!f) return PI_FILE_NONE;