SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
main.cpp File Reference
#include "mission.hpp"
#include "msg_arbiter.hpp"
#include "ota.hpp"
#include "startup.hpp"
#include <satnogs-comms-lib/board.hpp>
#include <zephyr/kernel.h>

Go to the source code of this file.

Functions

int main (void)
 The main sequence to initialize the Satnogs-COMMS board.

Function Documentation

◆ main()

int main ( void )

The main sequence to initialize the Satnogs-COMMS board.

flowchart TD A[Enter the main sequence] --> B[Initialize HW Watchdog if not enabled by bootloader] B --> C[Add WDT task and get wdt id] C --> D[Call task_wdt_feed to activate the IWDG internally] D --> E[Get error handler instance which will parse the reason of reset] E --> F[Start ADC monitors] F --> G[Get board settings instance] G --> H[Initialize the board inistance with io and hw configuration] H --> I[Get board instance, along with the radio fpga, and leds reference] I --> J[Get msg_arb, io_ctrl, io_wdg, and logger] J --> K[Log board version information via the boot logging method] K --> L[Call the enable method of the radio class] L --> M[Disable UHF and SBAND radio] M --> N[Disable FPGA] N --> O[Feed the main WDT] O --> Q{Is the board marked as deployed in settings?} Q -->|No| R[Log that this is the first boot and wait for the holdoff period to deploy the antenna while feeding the WDT] Q -->|Yes| S[Log that the antennas has been already deployed] R --> T[Increment the boot count in board settings] S --> T[Initialize the main work queue] T --> U[Start the msg_arb, the io_ctrl, and the io_wdg threads] U --> V[Feed the main WDT] V --> W[Activate the IRQ] W --> X[Initialize a non-delayable work structure] X --> Y[Set UHF filter and RX frequency and call the rx_async method] Y --> Z[Set SBAND filter and RX frequency and call the rx_async method] Z --> AA[Log that all threads started successfully!]

Definition at line 38 of file main.cpp.