Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MLRTP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amber-Sophia Schröck
MLRTP
Commits
8542d4fa
Commit
8542d4fa
authored
6 years ago
by
Amber-Sophia Schröck
Browse files
Options
Downloads
Patches
Plain Diff
update mnthread an esp32-rtp
parent
aff953c4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/esp32-rtp
+1
-1
1 addition, 1 deletion
lib/esp32-rtp
src/__main.cpp
+13
-4
13 additions, 4 deletions
src/__main.cpp
with
14 additions
and
5 deletions
esp32-rtp
@
a85d16f3
Subproject commit
d7700ff23a76f09dd4e730ef9204048e935c4f7e
Subproject commit
a85d16f377ab1191f83a3c5e6d178a471e760910
This diff is collapsed.
Click to expand it.
src/__main.cpp
+
13
−
4
View file @
8542d4fa
#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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment