3 * Check the Pi's LOW-Power signal.
5 * This is a demonstration program that could be turned into some sort
6 * of logger via e.g. syslog - however it's also probably something
7 * that might be better handled by a future kernel - who knows.
9 * Copyright (c) 2014 Gordon Henderson.
10 ***********************************************************************
11 * This file is part of wiringPi:
12 * https://projects.drogon.net/raspberry-pi/wiringpi/
14 * wiringPi is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
19 * wiringPi is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License for more details.
24 * You should have received a copy of the GNU Lesser General Public License
25 * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
26 ***********************************************************************
38 * This is an ISR that waits for the low-power signal going low and
40 *********************************************************************************
48 printf ("%s: LOW POWER DETECTED\n", ctime (&t)) ;
53 *********************************************************************************
55 *********************************************************************************
60 wiringPiSetupGpio () ; // GPIO mode as it's an internal pin
62 wiringPiISR (LOW_POWER, INT_EDGE_FALLING, &lowPower) ;