SatNOGS-COMMS
4.1.0
A COMMS subsystem for CubeSats
Toggle main menu visibility
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
/*
2
* SatNOGS-COMMS MCU software
3
*
4
* Copyright (C) 2022-2023, Libre Space Foundation <http://libre.space>
5
*
6
* This program is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*
19
* SPDX-License-Identifier: GNU General Public License v3.0 or later
20
*/
21
22
#include "
mission.hpp
"
23
#include "
msg_arbiter.hpp
"
24
#include "
ota.hpp
"
25
#include "
startup.hpp
"
26
#include <
satnogs-comms-lib/board.hpp
>
27
#include <zephyr/kernel.h>
28
29
namespace
sc
=
satnogs::comms
;
30
namespace
scl
=
sc::lib
;
31
37
int
38
main
(
void
)
39
{
40
auto
&err =
sc::error_handler::get_instance
();
41
auto
&startup =
sc::startup::get_instance
();
42
startup.prepare();
43
startup.start();
44
auto
&leds =
scl::board::get_instance
().
leds
();
45
46
while
(1) {
47
try
{
48
task_wdt_feed(startup.wdg_id());
49
k_msleep(500);
50
leds.toggle(
scl::leds::led::led0
);
51
leds.toggle(
scl::leds::led::led1
);
52
}
catch
(
const
scl::exception
&e) {
53
err.handle(e);
54
/*
55
* Exceptions that are not of the base type satnogs::comms::lib::exception
56
* are handled directly as critical
57
*/
58
}
catch
(std::exception &e) {
59
err.handle(e);
60
}
61
}
62
63
/*
64
* Exceptions that are not of the base type satnogs::comms::lib::exception
65
* are handled directly as critical
66
*/
67
68
return
0;
69
}
board.hpp
satnogs::comms::error_handler::get_instance
static error_handler & get_instance()
Singleton access to the error_handler subsystem.
Definition
error_handler.hpp:61
satnogs::comms::lib::board::leds
comms::lib::leds & leds()
Returns a reference to the LEDs subsystem.
Definition
board.cpp:124
satnogs::comms::lib::board::get_instance
static board & get_instance()
Gets a reference to the single instance of the Board interface class.
Definition
board.cpp:66
satnogs::comms::lib::exception
Exception base class.
Definition
exception.hpp:63
satnogs::comms::lib::leds::led::led1
@ led1
Definition
leds.hpp:47
satnogs::comms::lib::leds::led::led0
@ led0
Definition
leds.hpp:46
satnogs::comms::startup::get_instance
static startup & get_instance()
Get a singleton access to the startup subsystem.
Definition
startup.hpp:80
main
int main(void)
The main sequence to initialize the Satnogs-COMMS board.
Definition
main.cpp:38
mission.hpp
msg_arbiter.hpp
satnogs::comms::lib
Definition
ad8318.hpp:30
satnogs::comms
Definition
bsp.cpp:28
ota.hpp
startup.hpp
src
main.cpp
Generated by
1.17.0