Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
sys.path.insert(0, os.path.abspath('../../flight_software/state_machine/applications/flight/'))
sys.path.insert(0, os.path.abspath('../../flight_software/state_machine/frame/'))
sys.path.insert(0, os.path.abspath('../../flight_software/state_machine/drivers/emulation'))

# -- Project information

Expand Down
4 changes: 3 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ Overview
.. toctree::
:caption: Overview

overview/software_arch
building
overview/software_arch
overview/frame
overview/firmware
hardware

Applications
Expand Down
20 changes: 20 additions & 0 deletions docs/source/overview/firmware.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Firmware
=================================

Updating PyCubedMini Firmware
-----------------------------

Based on `these instructions <https://github.com/PyCubed-Mini/avionics-motherboard/blob/zac-updates/firmware/README.md>`_.
Instructions written for PycubedMiniV02.

#. Connect the PyCubed-Mini board to your computer via USB.
#. Quickly double click the "RESET" button on the board (only small black button on the board).
When the board boots into BOOTLOADER mode, the LED should be bright and white.
The board should also mount as `PYCUBEDBOOT`.
#. Then drag and drop the `update_bootloader.uf2 <https://github.com/PyCubed-Mini/avionics-motherboard/blob/zac-updates/firmware/pycubedminiv02/update_bootloader.uf2>`_ into the the `PYCUBEDBOOT` drive (do this).
However, renaming it to `CURRENT.uf2` and replacing the current `CURRENT.uf2` file in the drive also worked.
The board should automatically reboot and update.
#. Wait for the board to unmount, then remount in bootloader mode again.
#. Copy over `firmware.uf2 <https://github.com/PyCubed-Mini/avionics-motherboard/blob/zac-updates/firmware/pycubedminiv02/firmware.uf2>`_
#. The board should automatically reboot, and remount as `CIRCUITPY`
#. If the libraries/code require updating also update the `lib` directory and the relevant python files.
33 changes: 33 additions & 0 deletions docs/source/overview/frame.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Framework
=========

How the framework works
-----------------------

Using tasko (now called `CircuitPyton Async <https://github.com/kvc0/CircuitPython_async>`_) a set of tasks read from a config file are run at set intervals.
This means while a certain task is waiting for a response from something like the radio, other tasks are run.

A state machine is also defined in the config file. Each state has its own set of tasks to run (and their coresponding intervals).
All the details for transitions are handled by the state machine.

One can also define exit and enter functions for each state.

State Machine
-------------

.. automodule:: state_machine
:members:

Tasko
-----

.. automodule:: tasko
:members:

.. autofunction:: tasko.add_task
.. autofunction:: tasko.run_later
.. autofunction:: tasko.schedule
.. autofunction:: tasko.schedule_later
.. autofunction:: tasko.sleep
.. autofunction:: tasko.suspend
.. autofunction:: tasko.run