Koroutinen in FreeRTOS für Arduino


frohe weihnachten,

 ich wollte ein kleines projekt für koroutinen/tasks mit  freertos schreiben. ich habe mich gestern mal die variante für die koroutinen gesetzt und den folgenden code dem der hilfe von freertos unter:

https://www.freertos.org/croutineapi.html

zusammen geschrieben:

code: [select]


#include <arduino_freertos.h>
#include <liquidcrystal.h>
#include <croutine.h>

//define coroutine

void vapplicationidlehook();
void vacodisplayroutine(coroutinehandle_t xhandle, ubasetype_t uxhandle);


//globales
 liquidcrystal lcd(12, 11, 10, 5, 4, 3, 2);

 
//the setup function runs once when press reset or power board
void setup() {
 
      taskhandle_t xhandle;
      ubasetype_t uxindex;
     // create 2 co-routines @ priority 1.
     for( uxindex = 0; uxindex < 2; uxindex++ )
     {
         xcoroutinecreate( vacodisplayroutine, 1, uxindex);
     }

     vapplicationidlehook();
}

void loop()
{
  // empty. things done in tasks.
}

void vacodisplayroutine(coroutinehandle_t xhandle, ubasetype_t uxhandle){
  static const uint32_t xdelaytime = 200 / porttick_period_ms;
 
  crstart(xhandle);
  lcd.begin(16,1);
  for(;;) {
    lcd.clear();
    lcd.print("co-routine " + uxhandle);
    crdelay( xhandle, xdelaytime);
  }
  crend();
 
}

void vapplicationidlehook()
{
        vcoroutineschedule();
}


hierbei kommt es allerdings immer zu den fehlermeldungen beim linken:

quote
tmp/cckh14rg.ltrans0.ltrans.o: in function `vacodisplayroutine(void*, unsigned char)':
freertos.ino:43: undefined reference `vcoroutineaddtodelayedlist'
/tmp/cckh14rg.ltrans0.ltrans.o: in function `vapplicationidlehook':
freertos.ino:51: undefined reference `vcoroutineschedule'
/tmp/cckh14rg.ltrans0.ltrans.o: in function `setup':
freertos.ino:24: undefined reference `xcoroutinecreate'
freertos.ino:24: undefined reference `xcoroutinecreate'
/tmp/cckh14rg.ltrans0.ltrans.o: in function `vapplicationidlehook':
freertos.ino:51: undefined reference `vcoroutineschedule'
collect2: error: ld returned 1 exit status
bibliothek freertos in version 10.0.0-3 im ordner: freertos  wird verwendet
bibliothek liquidcrystal in version 1.0.7 im ordner: arduino-1.8.5/libraries/liquidcrystal  wird verwendet
exit status 1
fehler beim kompilieren für das board arduino/genuino uno.
weiß jemand woran dies liegen kann? warum werden die entsprechenden funktionen nicht eingebunden?

frohe weihnachten!

ich bezweifle, daß freertos auch die kleinen atmel prozessoren (uno...) unterstützt.


Arduino Forum > International > Deutsch (Moderator: uwefed) > Koroutinen in FreeRTOS für Arduino


arduino

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???