|
| 1 | +import os |
1 | 2 | import time |
2 | 3 |
|
| 4 | +import board |
3 | 5 | import digitalio |
4 | | - |
5 | | -try: |
6 | | - # from board_definitions import proveskit_rp2040_v4 as board |
7 | | - raise ImportError |
8 | | -except ImportError: |
9 | | - import board |
10 | | - |
11 | | -try: |
12 | | - pass |
13 | | -except Exception: |
14 | | - pass |
15 | | - |
16 | | -import os |
17 | | - |
18 | 6 | from lib.adafruit_mcp230xx.mcp23017 import ( |
19 | 7 | MCP23017, # This is Hacky V5a Devel Stuff### |
20 | 8 | ) |
|
52 | 40 |
|
53 | 41 | logger.info( |
54 | 42 | "Booting", |
55 | | - hardware_version=os.uname().version, |
| 43 | + hardware_version=os.uname().version, # type: ignore[attr-defined] |
56 | 44 | software_version=__version__, |
57 | 45 | ) |
58 | 46 |
|
@@ -147,44 +135,6 @@ def get_temp(sensor): |
147 | 135 | sband_radio, |
148 | 136 | ) |
149 | 137 |
|
150 | | - |
151 | | -def dumb_burn(duration=5) -> None: |
152 | | - """ |
153 | | - This function is used to test the burn wire. |
154 | | - It will turn on the burn wire for 5 seconds and then turn it off. |
155 | | -
|
156 | | - Args: |
157 | | - duration (int): The duration to burn for in seconds. Default is 5 seconds. |
158 | | - Returns: |
159 | | - None |
160 | | - """ |
161 | | - burnwire_heater_enable.value = False |
162 | | - burnwire1_fire.value = False |
163 | | - logger.info("Burn Wire Enabled") |
164 | | - time.sleep(duration) |
165 | | - logger.info("Burn Wire Disabled") |
166 | | - burnwire_heater_enable.value = True |
167 | | - burnwire1_fire.value = True |
168 | | - |
169 | | - |
170 | | -## Initializing the Heater ## |
171 | | -def heater_pulse() -> None: |
172 | | - """ |
173 | | - This function is used to turn on the heater. |
174 | | - It will turn on the heater for 5 seconds and then turn it off. |
175 | | -
|
176 | | - Args: |
177 | | - None |
178 | | - Returns: |
179 | | - None |
180 | | - """ |
181 | | - ENABLE_HEATER.value = False |
182 | | - logger.info("Heater Enabled") |
183 | | - time.sleep(5) |
184 | | - logger.info("Heater Disabled") |
185 | | - ENABLE_HEATER.value = True |
186 | | - |
187 | | - |
188 | 138 | ## Initialize the MCP23017 GPIO Expander and its pins ## |
189 | 139 | GPIO_RESET = initialize_pin( |
190 | 140 | logger, board.GPIO_EXPANDER_RESET, digitalio.Direction.OUTPUT, True |
@@ -264,13 +214,12 @@ def all_faces_on(): |
264 | 214 | temp_sensor1 = MCP9808Manager(logger, tca[1], addr=27) |
265 | 215 | temp_sensor2 = MCP9808Manager(logger, tca[2], addr=27) |
266 | 216 | temp_sensor3 = MCP9808Manager(logger, tca[3], addr=27) |
267 | | -# temp_sensor4 = MCP9808Manager(logger, tca[4], addr=27) |
| 217 | +temp_sensor4 = MCP9808Manager(logger, tca[4], addr=27) |
| 218 | + |
| 219 | + |
| 220 | +battery_power_monitor: PowerMonitorProto = INA219Manager(logger, i2c1, 0x40) |
| 221 | +solar_power_monitor: PowerMonitorProto = INA219Manager(logger, i2c1, 0x44) |
268 | 222 |
|
269 | | -try: |
270 | | - battery_power_monitor: PowerMonitorProto = INA219Manager(logger, i2c1, 0x40) |
271 | | - solar_power_monitor: PowerMonitorProto = INA219Manager(logger, i2c1, 0x44) |
272 | | -except Exception as e: |
273 | | - logger.error("Error Initializing Power Monitors", e) |
274 | 223 |
|
275 | 224 | ## Init Misc Pins ## |
276 | 225 | burnwire_heater_enable = initialize_pin( |
|
0 commit comments