QuantumLeaps / qpcpp

QP/C++ Real-Time Embedded Framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
https://www.state-machine.com/products/qp
386 stars 82 forks source link

Port for ESP32 #14

Closed vChavezB closed 2 years ago

vChavezB commented 2 years ago

Currently, I am working with students at a University which have a systems engineering course. I was thinking of using the QP framework as a practical experience in programming state machines from UML diagrams. At first, I was going to use the Arduino DUE which already has a port for Arduino. After checking the logistics of buying more than 20 Arduino DUE's, I saw that the ESP32 is way cheaper to buy in bulk.

Based on the port from QP/C, I have ported the version to its C++ counterpart since we will be using C++ for the practical part of the course.

Changes from ESP-IDF port for QP/C

TODO

How to Test

Arduino IDE

I have added an example for usage with the Arduino framework based on the blinky-bsp-sam. To use the example you need the ESP32 QP/C++ Library for arduino I made to test this port.

Arduino ESP32 Simulator

Another way to test the library is with the interesting simulator from Wokwi. This simulator uses the Arduino SDK and supports the ESP32 board. This is the way I actually tested the port since I do not have an ESP32 at the moment.

I made two projects

1) Uploaded all files to the wokwi website and can be modified directly, including the qpcpp library

https://wokwi.com/projects/326458820073095763

2) Includes only the blinky demo and the library is added through the library manager of wokwi.

https://wokwi.com/projects/326558871953867348

To run them, you just need to click the green Play button. It should compile the software and simulate the ESP32. The simulator shows that the LED is blinking and changing periodically.

quantum-leaps commented 2 years ago

Hi vChavezB! I'm glad to see your work on QP/C++ port to ESP32.

Regarding the pull request, I can't merge it back into the official QuantumLeaps/qpcpp repo because of the implications on dual-licensing. But I'd be happy to add a section in the README.md file about your ESP32 port with a link to your repo on GitHub. I hope this sounds reasonable.

--MMS

vChavezB commented 2 years ago

Not a problem. 👍 You can definitely add a link to this port on my forked repository. My goal was to share the port and any results while I am working with the ESP32 and QP/C++.
Regards Victor

quantum-leaps commented 2 years ago

Hi vChavezB, I've just created a new repository https://github.com/QuantumLeaps/contributed , where you can add links and descriptions to the contributed software, like your ESP32 port. This "contributed" repository is specifically designed for third-party contributions, so any pull requests will be merged back. The intent there is to update the README.md file with short descriptions and links to contributions. I hope you understand what I mean. --MMS

vChavezB commented 2 years ago

Hello Miro,

that sounds reasonable. I will make a pull request to that repository :+1: