Skip to content

Commit

Permalink
Removing side effects from pysquared.py (#84)
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Gay <[email protected]>
  • Loading branch information
cosmiccodon and nateinaction authored Jan 9, 2025
1 parent e2bcec5 commit bf37905
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
11 changes: 3 additions & 8 deletions lib/pysquared/pysquared.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,15 @@ def __init__(self) -> None:
"""
Setting up data buffers
"""
# TODO(blakejameson): is this line in use? Remove if not?
# TODO(cosmiccodon/blakejameson):
# Data_cache, filenumbers, image_packets, and send_buff are variables that are not used in the codebase. They were put here for Orpheus last minute.
# We are unsure if these will be used in the future, so we are keeping them here for now.
self.data_cache: dict = {}
# TODO(blakejameson): is this line in use? Remove if not?
self.filenumbers: dict = {}
# TODO(blakejameson): is this line in use? Remove if not?
self.image_packets: int = 0
self.urate: int = 9600
self.buffer: bytearray = None
self.buffer_size: int = 1
# TODO(blakejameson): is this line in use? Remove if not?
self.send_buff: memoryview = memoryview(SEND_BUFF)
self.micro: microcontroller = microcontroller

Expand Down Expand Up @@ -817,7 +816,3 @@ def new_file(self, substring: str, binary: bool = False) -> Union[str, None]:
return None
else:
self.debug_print("[WARNING] SD Card not initialized")


print("Initializing CubeSat")
cubesat = Satellite()
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import time
import microcontroller
import lib.pysquared.pysquared as pysquared

print("=" * 70)
print("Hello World!")
Expand All @@ -24,8 +25,8 @@
print(f"Code Starting in {loiter_time-i} seconds")
time.sleep(1)

from lib.pysquared.pysquared import cubesat as c

print("Initializing CubeSat")
c = pysquared.Satellite()
c.watchdog_pet()

import asyncio
Expand All @@ -48,7 +49,7 @@ def initial_boot():
c.watchdog_pet()
# f.state_of_health()
# f.listen()
c.watchdog_pet()
# c.watchdog_pet()

try:
c.c_boot += 1 # Increment boot number
Expand Down
3 changes: 2 additions & 1 deletion repl.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
print("Initializing a cubesat object as `c` in the REPL...")
import lib.pysquared.pysquared as pysquared

from lib.pysquared.pysquared import cubesat as c
c = pysquared.Satellite()

0 comments on commit bf37905

Please sign in to comment.