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