Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
On-Board Software
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
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
On-Board Software
Commits
172f187b
Commit
172f187b
authored
1 year ago
by
Davide Mor
Browse files
Options
Downloads
Patches
Plain Diff
[Main] Changed all initial LOG_ERR into prints
parent
ab5916b9
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!36
[Main] Merge Main OBSW
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/boards/Main/Configs/SensorsConfig.h
+1
-1
1 addition, 1 deletion
src/boards/Main/Configs/SensorsConfig.h
src/boards/Main/Radio/Radio.cpp
+5
-5
5 additions, 5 deletions
src/boards/Main/Radio/Radio.cpp
src/entrypoints/Main/main-entry.cpp
+15
-18
15 additions, 18 deletions
src/entrypoints/Main/main-entry.cpp
with
21 additions
and
24 deletions
src/boards/Main/Configs/SensorsConfig.h
+
1
−
1
View file @
172f187b
This diff is collapsed.
Click to expand it.
src/boards/Main/Radio/Radio.cpp
+
5
−
5
View file @
172f187b
This diff is collapsed.
Click to expand it.
src/entrypoints/Main/main-entry.cpp
+
15
−
18
View file @
172f187b
...
...
@@ -34,7 +34,7 @@
#include
<interfaces-impl/hwmapping.h>
#include
<miosix.h>
#include
<
utils/ModuleManager/ModuleManager.hpp
>
#include
<
iostream
>
using
namespace
miosix
;
using
namespace
Boardcore
;
...
...
@@ -45,7 +45,6 @@ int main()
{
ledOff
();
PrintLogger
logger
=
Logging
::
getLogger
(
"main"
);
DependencyManager
manager
;
Buses
*
buses
=
new
Buses
();
...
...
@@ -72,7 +71,7 @@ int main()
if
(
!
initResult
)
{
LOG_ERR
(
logger
,
"Failed to inject dependencies"
)
;
std
::
cout
<<
"Failed to inject dependencies"
<<
std
::
endl
;
return
-
1
;
}
...
...
@@ -85,19 +84,19 @@ int main()
if
(
!
EventBroker
::
getInstance
().
start
())
{
initResult
=
false
;
LOG_ERR
(
logger
,
"Error failed to start EventBroker"
)
;
std
::
cout
<<
"Error failed to start EventBroker"
<<
std
::
endl
;
}
if
(
!
actuators
->
start
())
{
initResult
=
false
;
LOG_ERR
(
logger
,
"Error failed to start
Sens
ors module"
)
;
std
::
cout
<<
"Error failed to start
Actuat
ors module"
<<
std
::
endl
;
}
if
(
!
sensors
->
start
())
{
initResult
=
false
;
LOG_ERR
(
logger
,
"Error failed to start Sensors module"
)
;
std
::
cout
<<
"Error failed to start Sensors module"
<<
std
::
endl
;
}
else
{
...
...
@@ -107,7 +106,7 @@ int main()
if
(
!
radio
->
start
())
{
initResult
=
false
;
LOG_ERR
(
logger
,
"Error failed to start Radio module"
)
;
std
::
cout
<<
"Error failed to start Radio module"
<<
std
::
endl
;
}
else
{
...
...
@@ -117,7 +116,7 @@ int main()
if
(
!
canHandler
->
start
())
{
initResult
=
false
;
LOG_ERR
(
logger
,
"Error failed to start CanHandler module"
)
;
std
::
cout
<<
"Error failed to start CanHandler module"
<<
std
::
endl
;
}
else
{
...
...
@@ -127,49 +126,47 @@ int main()
if
(
!
pinHandler
->
start
())
{
initResult
=
false
;
LOG_ERR
(
logger
,
"Error failed to start PinHandler module"
)
;
std
::
cout
<<
"Error failed to start PinHandler module"
<<
std
::
endl
;
}
if
(
!
scheduler
->
start
())
{
initResult
=
false
;
LOG_ERR
(
logger
,
"Error failed to start scheduler"
)
;
std
::
cout
<<
"Error failed to start scheduler"
<<
std
::
endl
;
}
if
(
!
fmm
->
start
())
{
initResult
=
false
;
LOG_ERR
(
logger
,
"Error failed to start FlightModeManager"
)
;
std
::
cout
<<
"Error failed to start FlightModeManager"
<<
std
::
endl
;
}
if
(
!
initResult
)
{
LOG_ERR
(
logger
,
"Init failure!"
)
;
std
::
cout
<<
"Init failure"
<<
std
::
endl
;
EventBroker
::
getInstance
().
post
(
FMM_INIT_ERROR
,
TOPIC_FMM
);
actuators
->
setStatusErr
();
}
else
{
LOG_INFO
(
logger
,
"All good!"
)
;
std
::
cout
<<
"All good!"
<<
std
::
endl
;
EventBroker
::
getInstance
().
post
(
FMM_INIT_OK
,
TOPIC_FMM
);
actuators
->
setStatusOk
();
led4On
();
}
std
::
cout
<<
"Sensor status:"
<<
std
::
endl
;
for
(
auto
info
:
sensors
->
getSensorInfos
())
{
LOG_INFO
(
logger
,
"{} {}"
,
info
.
isInitialized
,
info
.
id
);
std
::
cout
<<
"- "
<<
info
.
id
<<
" status: "
<<
info
.
isInitialized
<<
std
::
endl
;
}
while
(
true
)
{
gpios
::
boardLed
::
low
();
// actuators->setAbkPosition(0.1f);
canHandler
->
sendEvent
(
Common
::
CanConfig
::
EventId
::
ARM
);
Thread
::
sleep
(
1000
);
gpios
::
boardLed
::
high
();
// actuators->setAbkPosition(0.5f);
canHandler
->
sendEvent
(
Common
::
CanConfig
::
EventId
::
DISARM
);
Thread
::
sleep
(
1000
);
}
...
...
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