Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ICBM
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
detectors
DSSC
ICBM
Commits
063a109d
Commit
063a109d
authored
2 weeks ago
by
Cyril Danilevski
Browse files
Options
Downloads
Patches
Plain Diff
Run web server on separate core
parent
8b8c0e5b
No related branches found
No related tags found
No related merge requests found
Pipeline
#166419
passed
2 weeks ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
icbm.ino
+29
-8
29 additions, 8 deletions
icbm.ino
with
29 additions
and
8 deletions
icbm.ino
+
29
−
8
View file @
063a109d
...
...
@@ -7,6 +7,9 @@ unsigned long start;
extern
bool
eth_connected
;
extern
SNMP
::
Manager
snmp
;
TaskHandle_t
restServerTask
;
TaskHandle_t
powerProcedureTask
;
void
setup
()
{
Serial
.
begin
(
115200
);
...
...
@@ -22,6 +25,11 @@ void setup() {
PINS
.
ramping
=
false
;
start
=
millis
();
xTaskCreatePinnedToCore
(
webInterfaceLoop
,
"Web Interface"
,
10000
,
NULL
,
1
,
&
restServerTask
,
0
);
xTaskCreatePinnedToCore
(
mainLoop
,
"PowerProcedure Task"
,
10000
,
NULL
,
1
,
&
powerProcedureTask
,
1
);
}
enum
{
...
...
@@ -37,13 +45,26 @@ void serialLoop() {
}
}
void
loop
()
{
isr_check_loop
();
snmp
.
loop
();
restServer
.
handleClient
();
toggle_status_led
();
serialLoop
();
if
(
eth_connected
)
{
// We may be triggered, but disconnected from the network.
powerOffCheckLoop
();
void
webInterfaceLoop
(
void
*
pvParameters
)
{
Serial
.
print
(
"Web loop running on core "
);
Serial
.
println
(
xPortGetCoreID
());
while
(
true
)
{
restServer
.
handleClient
();
}
}
void
mainLoop
(
void
*
pvParameters
)
{
Serial
.
print
(
"main loop running on core "
);
Serial
.
println
(
xPortGetCoreID
());
while
(
true
)
{
isr_check_loop
();
snmp
.
loop
();
toggle_status_led
();
serialLoop
();
if
(
eth_connected
)
{
// We may be triggered, but disconnected from the network.
powerOffCheckLoop
();
}
}
}
void
loop
()
{}
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