dimanche 1 mars 2015

Activate driver from C/C++ program Debian


Trying to activate a GPIO driver from within a C/C++ program for BeagleBone Black-Debian. Instead of activating the driver I get this error message "sh: 1: cannot create /sys/devices/bone_capemgr./slots: Directory nonexistent" If I type "echo cape-bone-iio > /sys/devices/bone_capemgr./slots" directly in the SSH terminal it works fine. Any insights are appreciated.



#include <stdio.h>
#include <stdlib.h>

int main()
{
printf( "Activate Analog GPIO driver\n" );
system( "echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots" );
printf( "done\n" );
return 0;
}



Aucun commentaire:

Enregistrer un commentaire