Skip to content
Snippets Groups Projects
Commit 8542d4fa authored by Amber-Sophia Schröck's avatar Amber-Sophia Schröck
Browse files

update mnthread an esp32-rtp

parent aff953c4
No related branches found
No related tags found
No related merge requests found
esp32-rtp @ a85d16f3
Subproject commit d7700ff23a76f09dd4e730ef9204048e935c4f7e
Subproject commit a85d16f377ab1191f83a3c5e6d178a471e760910
#include <stdio.h>
#include <libmn.h>
#include "rtprandomesp.h"
#include "esp_system.h"
#define TASk_ON_CPU LIBMN_CPU_1
class basic_task : public mthread {
......@@ -8,24 +11,30 @@ public:
basic_task() : mthread("basic_task", 5, 2048) { }
virtual void* on_thread() {
mthread::on_thread();
int id = get_id();
int core = get_on_core();
m_pRandEsp32.set_seed(esp_random());
for(int i=10;i!=0;i--) {
printf("[%d:%d] End thread in %d seconds\n", id, core,i);
sleep(1);
printf("[%d:%d] Random number: %d\n", id, core, m_pRandEsp32.get_random32());
mn_sleep(1);
}
printf("[%d:%d] End thread\n", id, core);
esp_restart();
return 0;
}
private:
RTPRandomEsp32 m_pRandEsp32;
};
extern "C" void app_main() {
printf("Thank you for using libmnthread version: %s\n",
libmn_version.to_string().c_str());
sleep(3);
mn_sleep(3);
basic_task basic_task;
basic_task.create(TASk_ON_CPU);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment