/* quick & dirty check of whether the lid-closed button is pressed */ /* Adam Tilghman, 5/2005, released into the public domain */ #include #include "hardware.h" //#define CLPS7111_VIRT_BASE 0xff000000 //#define PBDR 0x0001 int main(int argc, char **argv) { unsigned char c = *(unsigned char *) (CLPS7111_VIRT_BASE+PBDR); if (c & 0x08 ) { /* lid switch is connected to PB bit four */ return 1; /* open */ } else { return 0; } }