23 #include <sys/types.h>
25 #include "../c_wrapper/pruio_c_wrapper.h"
32 struct timeval timeout;
37 FD_SET(STDIN_FILENO, &set);
41 timeout.tv_usec = mseconds * 1000;
44 return TEMP_FAILURE_RETRY(select(FD_SETSIZE,
50 #define OUT_K pruio_gpio_out(io, PIN, 1) ; isleep(250) ; pruio_gpio_out(io, PIN, 0) ; isleep(150) ;
51 #define OUT_L pruio_gpio_out(io, PIN, 1) ; isleep(750) ; pruio_gpio_out(io, PIN, 0) ; isleep(150) ;
52 #define OUT_S OUT_K ; OUT_K ; OUT_K ; isleep(250)
53 #define OUT_O OUT_L ; OUT_L ; OUT_L ; isleep(250)
55 int main(
int argc,
char **argv)
60 printf(
"initialisation failed (%s)\n", io->
Errr);
break;}
63 printf(
"pin configuration failed (%s)\n", io->
Errr);
break;}
66 printf(
"config failed (%s)\n", io->
Errr);
break;}
68 printf(
"watch SOS code on user LED 3 (near ethernet connector)\n\n");
69 printf(
"execute the following command to get rid of mmc1 triggers\n");
70 printf(
" sudo su && echo none > /sys/class/leds/beaglebone:green:usr3/trigger && exit\n\n");
71 printf(
"press any key to quit");
73 struct termios oldt, newt;
74 tcgetattr( STDIN_FILENO, &oldt );
76 newt.c_lflag &= ~( ICANON | ECHO );
79 tcsetattr( STDIN_FILENO, TCSANOW, &newt );
81 while(0 >= getchar()) {
88 tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
92 printf(
"pin re-configuration failed (%s)\n", io->
Errr);