quantumleaps / qp-arduino Goto Github PK
View Code? Open in Web Editor NEWQP real-time embedded frameworks/RTOS for Arduino (AVR and SAM)
Home Page: https://www.state-machine.com/arduino
License: GNU General Public License v3.0
QP real-time embedded frameworks/RTOS for Arduino (AVR and SAM)
Home Page: https://www.state-machine.com/arduino
License: GNU General Public License v3.0
The current installation of the library is done by cloning this repository and selecting the version you want to use (arm or avr) and copying it to the Arduino Library path.
Officially Arduino has a registry repository where any library can be added and made accessible via the Arduino library manager.
https://github.com/arduino/library-registry
Why hasn't it been thought to use the official Arduino method?
Hello!
We've used qp-arduino for quite a while now on Teensy 4.0 and Teensy 4.1.
As the project becomes more and more involved I wanted to update to the latest version to incorporate QSPY and (proper) UnitTesting.
Adapting the Teensy-example provided with this release was easy enough to get the expected Q-SPY output. But a few issues and questions remain:
Why are QS::onCleanup()
, QS::onGetTime()
, QS::onFlush()
and QS::onReset()
needed, even when Q-Spy is disabled (QS_ON not defined). This seems to be inconsistent with QS::onStartup()
and QS::onCommand()
, which do not necessarily have to be implemented. This is not a problem, just a question, though.
When QF::poolInit(...)
is called before QS::onStartup()
runs, Teensy resets itself. So far I've tracked it down to these BSP-calls in QS::onStartup(void const * arg):
static uint8_t qsTxBuf[1024]; // buffer for QS transmit channel (QS-TX)
static uint8_t qsRxBuf[128]; // buffer for QS receive channel (QS-RX)
initBuf (qsTxBuf, sizeof(qsTxBuf));
rxInitBuf(qsRxBuf, sizeof(qsRxBuf));
If initBuf and rxInitBuf are not called before initializing the event pool (QF::poolInit(...)
) the MCU resets. This means, that without QS_ON no event pool can currently be used, as this surpresses the call to QS::onStartup().
To reproduce, add these lines to the Teensy setup() method after BSP::init();:
DMAMEM static QF_MPOOL_EL(uint64_t) BigPoolSto[50];
QF::poolInit(BigPoolSto, sizeof(BigPoolSto), sizeof(BigPoolSto[0]));
As long as QS_ON is defined, the code should run fine. However, if QS_ON is not defined, the MCU should crash and reset itself.
Here is the code I used to test and reproduce the problem. If you extract it into /libraries/qpcpp_arm-cm/examples/blinky-qspy-teensy4/ it should be directly executable with PlatformIO.
teensy.zip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.