Skip to content

Commit 51a86f2

Browse files
ineskhouMikefly123nateinaction
authored
Mike loadswitch proto v5b (#16)
* Bump PySquared Version * Replaced Sleep Helper with CDH Listen * Update pysquared reference * HOTFIX: Remove Magnetometer From Beacon * Update to 25w40 * added load switch to repl * points to new release * appease linter --------- Co-authored-by: Michael Pham <[email protected]> Co-authored-by: Nate Gay <[email protected]>
1 parent 5360f3a commit 51a86f2

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PYSQUARED_VERSION ?= v2.0.0-alpha-25w40
1+
PYSQUARED_VERSION ?= v2.0.0-alpha-25w40a
22
PYSQUARED ?= git+https://github.com/proveskit/pysquared@$(PYSQUARED_VERSION)\#subdirectory=circuitpython-workspaces/flight-software
33
BOARD_MOUNT_POINT ?= ""
44
BOARD_TTY_PORT ?= ""

src/flight-software/repl.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
from lib.pysquared.hardware.digitalio import initialize_pin
1818
from lib.pysquared.hardware.imu.manager.lsm6dsox import LSM6DSOXManager
1919
from lib.pysquared.hardware.light_sensor.manager.veml7700 import VEML7700Manager
20+
from lib.pysquared.hardware.load_switch.manager.loadswitch_manager import (
21+
LoadSwitchManager,
22+
)
2023
from lib.pysquared.hardware.magnetometer.manager.lis2mdl import LIS2MDLManager
2124
from lib.pysquared.hardware.power_monitor.manager.ina219 import INA219Manager
2225
from lib.pysquared.hardware.radio.manager.rfm9x import RFM9xManager
@@ -33,6 +36,7 @@
3336

3437
rtc = MicrocontrollerManager()
3538

39+
3640
logger: Logger = Logger(
3741
error_counter=Counter(0),
3842
colorized=False,
@@ -169,27 +173,34 @@ def get_temp(sensor):
169173
PAYLOAD_PWR_ENABLE.direction = digitalio.Direction.OUTPUT
170174

171175

176+
load_switch_0 = LoadSwitchManager(FACE0_ENABLE, True) # type: ignore , upstream on mcp TODO
177+
load_switch_1 = LoadSwitchManager(FACE1_ENABLE, True) # type: ignore , upstream on mcp TODO
178+
load_switch_2 = LoadSwitchManager(FACE2_ENABLE, True) # type: ignore , upstream on mcp TODO
179+
load_switch_3 = LoadSwitchManager(FACE3_ENABLE, True) # type: ignore , upstream on mcp TODO
180+
load_switch_4 = LoadSwitchManager(FACE4_ENABLE, True) # type: ignore , upstream on mcp TODO
181+
182+
172183
# Face Control Helper Functions
173184
def all_faces_off():
174185
"""
175186
This function turns off all of the faces. Note the load switches are disabled low.
176187
"""
177-
FACE0_ENABLE.value = False
178-
FACE1_ENABLE.value = False
179-
FACE2_ENABLE.value = False
180-
FACE3_ENABLE.value = False
181-
FACE4_ENABLE.value = False
188+
load_switch_0.disable_load()
189+
load_switch_1.disable_load()
190+
load_switch_2.disable_load()
191+
load_switch_3.disable_load()
192+
load_switch_4.disable_load()
182193

183194

184195
def all_faces_on():
185196
"""
186197
This function turns on all of the faces. Note the load switches are enabled high.
187198
"""
188-
FACE0_ENABLE.value = True
189-
FACE1_ENABLE.value = True
190-
FACE2_ENABLE.value = True
191-
FACE3_ENABLE.value = True
192-
FACE4_ENABLE.value = True
199+
load_switch_0.enable_load()
200+
load_switch_1.enable_load()
201+
load_switch_2.enable_load()
202+
load_switch_3.enable_load()
203+
load_switch_4.enable_load()
193204

194205

195206
## Face Sensor Stuff ##

0 commit comments

Comments
 (0)