RobotSimulation/pick_and_place/ROS/src/niryo_one_ros/mcp_can_rpi/src/mcp_can_rpi.cpp
bool MCP_CAN::setupInterruptGpio()
{
#ifdef __arm__
    int result = wiringPiSetupGpio();
    if (!result) {
        printf("Gpio started\n");
    }
    else {
        printf("Gpio startup fail\n");
        return false;
    }
    
    pinMode(gpio_can_interrupt, INPUT);
    nanosleep((const struct timespec[]){{0, 500000L}}, NULL);
    return true;
#else
    printf("Can't use GPIO on non-ARM processor");
    return false;
#endif
}
/*********************************************************************************************************
** Function name:           setupInterruptGpio
** Descriptions:            Setups interrupt GPIO pin as input on Raspberry Pi (using wiringPi)
*********************************************************************************************************/
Function name:           setupInterruptGpio
Descriptions:            Setups interrupt GPIO pin as input on Raspberry Pi (using wiringPi)
Function name : setupInterruptGpio Descriptions : Setups interrupt GPIO pin as input on Raspberry Pi ( using wiringPi )
bool MCP_CAN::setupInterruptGpio()
{
#ifdef __arm__
    int result = wiringPiSetupGpio();
    if (!result) {
        printf("Gpio started\n");
    }
    else {
        printf("Gpio startup fail\n");
        return false;
    }
    pinMode(gpio_can_interrupt, INPUT);
    nanosleep((const struct timespec[]){{0, 500000L}}, NULL);
    return true;
#else
    printf("Can't use GPIO on non-ARM processor");
    return false;
#endif
}
bool MCP_CAN :: setupInterruptGpio ( ) { #ifdef __arm__ int result = wiringPiSetupGpio ( ) ; if ( ! result ) { printf ( " \n " ) ; } else { printf ( " \n " ) ; return false ; } pinMode ( gpio_can_interrupt , INPUT ) ; nanosleep ( ( const struct timespec [ ] ) { { 0 , 500000L } } , NULL ) ; return true ; #else printf ( " " ) ; return false ; #endif }
Function name:           setupInterruptGpio
Descriptions:            Setups interrupt GPIO pin as input on Raspberry Pi (using wiringPi)
Function name : setupInterruptGpio Descriptions : Setups interrupt GPIO pin as input on Raspberry Pi ( using wiringPi )