(NextionDisplay: https://www.exp-tech.de/displays/tft/76 ... lay?c=1074)
(NextionLibrary: https://github.com/itead/ITEADLIB_Arduino_Nextion)
Below a snippet on how I created the threads:
Code: Select all
#include "NextionChibiOS.h"
#include <Arduino.h>
#include ...
#include <ChRt.h>
#define THREAD_MEMORY 512
...
void displayThread() {
while( true ) {
// nexLoop(touchListeners); // NextionDisplay query touch events does not function here
}
}
THD_WORKING_AREA(displayArea, THREAD_MEMORY);
THD_FUNCTION(displayStart, arg) {
displayThread();
}
void startThreads() {
ch_thread *displayThread = chThdCreateStatic(displayArea, sizeof(displayArea), HIGHPRIO, displayStart, NULL);
}
void setup() {
chBegin(startThreads);
}
void loop() {
nexLoop(touchListeners); // NextionDisplay query touch events does function here
}
Thank you beforehand & best regards,
Siegfried