Giter Club home page Giter Club logo

Comments (6)

me-no-dev avatar me-no-dev commented on July 19, 2024

Compiled binaries are standard Linux executables, so you can use basically anything that is available on linux (given that you have the required libs and headers on the build machine)

from raspiarduino.

shiftleftplusone avatar shiftleftplusone commented on July 19, 2024

ok, but IIUYC, I am crosscompiling from a Windows-PC-based Arduino IDE to the Pi code,
so does the Arduino IDE know what do if I
#include <pthread.h>
at the top and then start the threads


void* thread0 (void* ) {       //  
    while(1) {    		
    //
    }
    return NULL;
}
void* thread1 (void* ) {       //  
    while(1) {    		
    //
    }
    return NULL;
}
void* thread2 (void* ) {       //  
    while(1) {    		
    //
    }
    return NULL;
}


void setup(){
    pthread_t  tid0, tid1, tid2;
    struct  sched_param  param;

    pthread_create(&tid0, NULL, thread0, NULL);    //  
    param.sched_priority = 20;
    pthread_setschedparam(tid0, SCHED_RR, &param);
   
    pthread_create(&tid1, NULL, thread1, NULL);    //  
    param.sched_priority = 30;
    pthread_setschedparam(tid1, SCHED_FIFO, &param);

    pthread_create(&tid2, NULL, thread2, NULL);    //  
    param.sched_priority = 30;
    pthread_setschedparam(tid2, SCHED_RR, &param);

   // *snip*
}

void loop()  {
//
}

AFAIK, Arduino #includes only lib files located in \program files (x86) \Arduino\libraries\ in a proprietary folder of the same name as the lib header.
But there is no pthread folder containing pthread.h and pthread.c and all that - how does one get it there?
For the Scheduler libs (Arduino Due) that works, also for Babix and RTOS48 on ARMs and AVRs -
but are you sure that POSIX pthread will work that way,compiled on a PC,and then uploaded?

from raspiarduino.

me-no-dev avatar me-no-dev commented on July 19, 2024

yes :) As a matter of fact, RaspiArduino has threads already running underneath ;) Serial events, monitor socket and some other things have their own threads. And there already is some api added for pthreads in Arduino.h

from raspiarduino.

shiftleftplusone avatar shiftleftplusone commented on July 19, 2024

that's awesome.
Currently I am still a little scared about the monster installation guide (a install.exe which does all what's needed would be very much appreciated though ;) ) - but perhaps I can persuade myself and give it a try then, hopefully soon. ;)

from raspiarduino.

me-no-dev avatar me-no-dev commented on July 19, 2024

There are some things that can not (should not) be done in an installer, because they are external dependencies that have their own licenses and all (it's actually one thing and that is the toolchain for windows). On the PI itself, many things are optional and depend on each user's preferences. I will at some point make some sort of script to automate the things on the PI at least for the bare minimum.

from raspiarduino.

shiftleftplusone avatar shiftleftplusone commented on July 19, 2024

thanks, that's highly appreciated! 8)

from raspiarduino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.