Skip to content
  • 0 Votes
    1 Posts
    177 Views
    No one has replied
  • 0 Votes
    12 Posts
    1k Views
    aminaA

    @amina

    I posted this in an other forum because it has been a while that I am stuck and it has to be fixed .. I am going to share the solution it may help someone https://stackoverflow.com/questions/66869600/timer-couldnt-work-with-wiringpiisr-qtquick-application/66873812?noredirect=1#comment118230663_66873812

    static instances of QObject are also not supported

    so the instance vitesse should be created after QApplication.
    this will fix the problem :

    static void isrInput_vitesse(); static Capteur_Input *vitesse = nullptr; static void isrInput_vitesse() { if(!vitesse) //not initialized yet return; QMetaObject::invokeMethod( vitesse, "isrCallback", Qt::QueuedConnection ); //or blockingQueue if you need to handle it directly in Qt way. } and in the main fucntion int main(int argc, char *argv[]) { QApplication a(argc, argv); //..... your main application body vitesse = new Capteur_Input(Pin_vitesse,PUD_OFF,INT_EDGE_RISING,isrInput_vitesse); ctx->setContextProperty("vitesse", vitesse); //... }

    the function isrCallback should be a slot

  • 0 Votes
    13 Posts
    1k Views
    Pablo J. RoginaP

    @amina said in could not add wiringPi to Qt after cross compiling:

    I just need to synchronize the /usr/include and /usr/lib or all the sysroot?

    It depends on the changes you do, and if you know exactly what folders were modified.
    Some people perform the sync for the whole sysroot just in case.