Ke Ao Teensy Flight Software
The software on the Teensy in the Ke Ao cubesat.
Loading...
Searching...
No Matches
main.cpp File Reference

The main operating loop for the Teensy. More...

#include "artemis_devices.h"
#include "artemisbeacons.h"
#include "channels/artemis_channels.h"
#include "tests/tests.h"
#include <Arduino.h>
#include <USBHost_t36.h>
#include <pdu.h>
#include <support/configCosmosKernel.h>
#include <vector>

Functions

void setup ()
 Initialization code.
 
void loop ()
 Operating code.
 

Detailed Description

The main operating loop for the Teensy.

This file contains the main oprerating loop that runs on the Teensy. Like an Arduino sketch, it consists of a setup and loop function, the latter of which constantly runs in a loop.

Function Documentation

◆ loop()

void loop ( )

Operating code.

Periodically checks for incoming packets and polls the attached sensors. This function runs in a loop forever, after setup() completes.

In each iteration of the loop() function, the main_queue is checked for a packet. If there is one, it is routed to its intended destination by adding that packet to the appropriate queue. That queue corresponds to a thread, which processes that packet when it has processing time.

Additionally, the sensors are periodically polled, with the corresponding readings updated. The GPS sensor's readings are updated on each iteration of the loop().

See the code for a detailed explaination.

◆ setup()

void setup ( )

Initialization code.

Initializes the various sensors and connections on the Teensy. This function is called once, upon powerup. The frequency of the Teensy's processor is also set here. Allowed frequencies in MHz are: 24, 150, 396, 450, 528, 600. The threads that the Teensy processes are set up. Each is allotted a fraction of processor time, and added to the thread_list.