Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add precommit hook #28

Closed
wants to merge 1 commit into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
2 changes: 1 addition & 1 deletion CircuitPy/Batt_Board/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# flight_controller_software
Software for the flight controller board in the PROVES Kit.
Software for the flight controller board in the PROVES Kit.
- **boot.py** This is the code that runs on boot and initializes the stack limit
- **cdh.py** This is the code that handles all the commands. A majority of this code is pulled from the cdh file developed by Max Holliday at Stanford.
- **code.py** This code runs the main operating system of the satellite and handles errors on a high level allowing the system to be fault tolerant
Expand Down
2 changes: 1 addition & 1 deletion CircuitPy/Batt_Board/code.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
In this method the PyCubed will wait a pre-allotted loiter time before proceeding to execute
main. This loiter time is to allow for a keyboard interupt if needed.
main. This loiter time is to allow for a keyboard interupt if needed.

Authors: Nicole Maggard and Michael Pham
"""
Expand Down
4 changes: 2 additions & 2 deletions CircuitPy/Batt_Board/lib/Big_Data.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
This class creates an object for each face of Yearling.
This class creates an object for each face of Yearling.

Authors: Antony Macar, Michael Pham, Nicole Maggard
Updated July 26, 2022
Updated July 26, 2022
v1.1
"""

Expand Down
4 changes: 2 additions & 2 deletions CircuitPy/Batt_Board/lib/battery_functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
This is the class that contains all of the functions for our CubeSat.
We pass the cubesat object to it for the definitions and then it executes
This is the class that contains all of the functions for our CubeSat.
We pass the cubesat object to it for the definitions and then it executes
our will.
Authors: Nicole Maggard and Michael Pham 12/26/2023
"""
Expand Down
6 changes: 3 additions & 3 deletions CircuitPy/Batt_Board/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def debug_print(statement):

# Defining Operations Within The Power Modes
"""These functions is called when the satellite transitions between various power states.
It generally thse modes manage the battery, checks the state of health of the system,
performs a reboot check, and then puts the system into a short hibernation
It generally thse modes manage the battery, checks the state of health of the system,
performs a reboot check, and then puts the system into a short hibernation
mode to conserve power.

When in low or critical power modes, the satellite will not perform any complex tasks.
When in low or critical power modes, the satellite will not perform any complex tasks.

The sub-functions that can be called are:
- `battery_manager()`: Manages and monitors the battery status.
Expand Down
4 changes: 2 additions & 2 deletions CircuitPy/FC_Board/lib/functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
This is the class that contains all of the functions for our CubeSat.
We pass the cubesat object to it for the definitions and then it executes
This is the class that contains all of the functions for our CubeSat.
We pass the cubesat object to it for the definitions and then it executes
our will.
Authors: Nicole Maggard, Michael Pham, and Rachel Sarmiento
"""
Expand Down
11 changes: 5 additions & 6 deletions CircuitPy/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Circuit Python Flight Software
In this subfolder you'll find the most recent stable flight software for the two main boards avalible to the PROVES Kit the Battery/EPS Board and the Flight Controller Board.
In this subfolder you'll find the most recent stable flight software for the two main boards avalible to the PROVES Kit the Battery/EPS Board and the Flight Controller Board.

## Tests
This folder contains various test scripts that should not be included for flight, but can be useful for debugging or data collection while still on the ground!

## Experimental
You'll also find a variety of experimental scripts and libraries in the Experimental Folder. Use these at your own risk as they can be useful but are not yet officially supported features.
## Tests
This folder contains various test scripts that should not be included for flight, but can be useful for debugging or data collection while still on the ground!

## Experimental
You'll also find a variety of experimental scripts and libraries in the Experimental Folder. Use these at your own risk as they can be useful but are not yet officially supported features.
28 changes: 14 additions & 14 deletions CircuitPy/Tests/radio_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
cubesat.radio1.enable_crc = False

print(
"""
=======================================
| |
| WELCOME! |
"""
=======================================
| |
| WELCOME! |
| Radio Test Version 1.0 |
| |
=======================================
| Please Select Your Node |
| Please Select Your Node |
| 'A': Device Under Test |
| 'B': Receiver |
=======================================
| 'B': Receiver |
=======================================
"""
)

Expand Down Expand Up @@ -132,9 +132,9 @@ def handle_ping():

else:
print(
"""
=======================================
| |
"""
=======================================
| |
| Verbose Output? (Y/N) |
| |
=======================================
Expand All @@ -149,10 +149,10 @@ def handle_ping():
debug_mode = False

print(
"""
=======================================
| |
| Beginning Radio Test |
"""
=======================================
| |
| Beginning Radio Test |
| Radio Test Version 1.0 |
| |
=======================================
Expand Down
3 changes: 0 additions & 3 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion PicoSDK/Batt_Pico_sdk/Battery_Software/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ target_include_directories(veml7700 PUBLIC lib)
target_include_directories(drv2605 PUBLIC lib)
target_include_directories(ads1015 PUBLIC lib)
target_include_directories(functions PUBLIC lib)
target_include_directories(big_data PUBLIC lib)
target_include_directories(big_data PUBLIC lib)
2 changes: 1 addition & 1 deletion PicoSDK/Batt_Pico_sdk/Battery_Software/boot/blink.pio
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
// Load configuration and jump to start of the program
pio_sm_init(pio, sm, offset, &cfg);
}
%}
%}
5 changes: 2 additions & 3 deletions PicoSDK/Batt_Pico_sdk/Battery_Software/boot/boot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main() {
uint neo_pwr = 25; //power pin for neopixel
uint neo_data = 24; //data pin for neopixel
uint sm_firm = 0; //state machine for led blinking
uint sm_wdt = 1; //state machine for watchdog timer
uint sm_wdt = 1; //state machine for watchdog timer
uint sm_neo = 2; //state machine for neopixel color changing
uint loiter_time = 10; //time to wait until executing code
generate_blink_pio_sm(pio_0,sm_firm,firm_active,offset_blink,pio_freq); //call method to generate a state machine for blinking the firmware LED
Expand All @@ -40,7 +40,7 @@ int main() {
sleep_ms(500);
neo.put_pixel(neo.urgb_u32(0x00,0x00,0x00));
sleep_ms(500);
neo.put_pixel(neo.urgb_u32(0xFF,0x00,0xFF));
neo.put_pixel(neo.urgb_u32(0xFF,0x00,0xFF));
printf("Entering main in %d seconds!\n",loiter_time-i-1);
}
main_program(neo); //enter main program
Expand All @@ -54,4 +54,3 @@ void generate_blink_pio_sm(PIO pio, uint sm, uint pin, uint offset, float clk_fr
printf("pio state machine generated for pin %d \n", pin);
return;
}

2 changes: 1 addition & 1 deletion PicoSDK/Batt_Pico_sdk/Battery_Software/boot/neopixel.pio
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ static inline void neopixel_program_init(PIO pio, uint sm, uint offset, uint pin
pio_sm_init(pio, sm, offset, &c);
pio_sm_set_enabled(pio, sm, true);
}
%}
%}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ void Big_Data::stopEffect(uint8_t channel) {
drv_motors.stop();
multiplexer.disableAllChannels();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ class Big_Data {
MCP9808 mcp_sensors;
VEML7700 veml_sensors;
DRV2605 drv_motors;
};
};
2 changes: 1 addition & 1 deletion PicoSDK/Batt_Pico_sdk/Battery_Software/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ target_link_libraries(veml7700 PRIVATE pico_stdlib hardware_i2c)
target_link_libraries(drv2605 PRIVATE pico_stdlib hardware_i2c)
target_link_libraries(ads1015 PRIVATE pico_stdlib hardware_i2c)
target_link_libraries(functions PRIVATE pico_stdlib hardware_pio hardware_gpio hardware_i2c neopixel tools pysquared big_data tca9548a)
target_link_libraries(big_data PRIVATE pico_stdlib hardware_i2c mcp9808 veml7700 drv2605 tca9548a)
target_link_libraries(big_data PRIVATE pico_stdlib hardware_i2c mcp9808 veml7700 drv2605 tca9548a)
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ uint16_t ADS1015::readRegister(uint8_t reg) {
i2c_write_blocking(i2c, address, data, 1, true);
i2c_read_blocking(i2c, address, data, 2, false);
return (data[0] << 8) | data[1];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class ADS1015 {

void writeRegister(uint8_t reg, uint16_t value);
uint16_t readRegister(uint8_t reg);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ void DRV2605::stop() {
void DRV2605::writeRegister(uint8_t reg, uint8_t value) {
uint8_t data[2] = {reg, value};
i2c_write_blocking(i2c, address, data, 2, false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ class DRV2605 {
uint8_t address;

void writeRegister(uint8_t reg, uint8_t value);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ uint16_t INA219::readRegister(uint8_t reg) {
i2c_write_blocking(i2c, address, &reg, 1, true);
i2c_read_blocking(i2c, address, data, 2, false);
return (data[0] << 8) | data[1];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class INA219 {
i2c_inst_t* i2c;
uint8_t address;


void calibrate(float max_current_amps, float max_voltage);
void writeRegister(uint8_t reg, uint16_t value);
uint16_t readRegister(uint8_t reg);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
#define MCP25625_TX1REQ 0x02
#define MCP25625_TX2REQ 0x04

#endif // MCP25625_H
#endif // MCP25625_H
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ void MCP25625Driver::handleError(const char *message) {
// Print error message to the console for now
printf("Error: %s\n", message);
// You may want to add more robust error handling based on your application requirements
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ class MCP25625Driver {
void handleError(const char *message);
};

#endif // MCP25625_DRIVER_H
#endif // MCP25625_DRIVER_H
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ float MCP9808::readTemperature() {
uint16_t rawTemperature = readRegister(0x05);
// MCP9808 temperature is in 13-bit format with a resolution of 0.0625 degrees Celsius per LSB
float temperature = static_cast<float>(rawTemperature & 0x0FFF) * 0.0625f;

// Check sign bit (bit 12)
if (rawTemperature & 0x1000) {
// Temperature is negative, apply two's complement
Expand All @@ -35,4 +35,4 @@ uint16_t MCP9808::readRegister(uint8_t reg) {
i2c_write_blocking(i2c, address, data, 1, true);
i2c_read_blocking(i2c, address, data, 2, false);
return (data[0] << 8) | data[1];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class MCP9808 {

void writeRegister(uint8_t reg, uint16_t value);
uint16_t readRegister(uint8_t reg);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ uint8_t PCA9685::readRegister(uint8_t reg) {
i2c_write_blocking(i2c, address, data, 1, true);
i2c_read_blocking(i2c, address, data, 1, false);
return data[0];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class PCA9685 {

void writeRegister(uint8_t reg, uint8_t value);
uint8_t readRegister(uint8_t reg);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ uint16_t PCT2075::readRegister(uint8_t reg) {
i2c_write_blocking(i2c, address, data, 1, true);
i2c_read_blocking(i2c, address, data, 2, false);
return (data[0] << 8) | data[1];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class PCT2075 {

void writeRegister(uint8_t reg, uint8_t value);
uint16_t readRegister(uint8_t reg);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ i2c_inst_t* TCA9548A::getChannelI2C(uint8_t channel) {
void TCA9548A::writeRegister(uint8_t reg, uint8_t value) {
uint8_t data[2] = {reg, value};
i2c_write_blocking(tca_i2c, tca_address, data, 2, false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ class TCA9548A{

void writeRegister(uint8_t reg, uint8_t value);
};
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ uint16_t VEML7700::readRegister(uint8_t reg) {
i2c_write_blocking(i2c, address, data, 1, true);
i2c_read_blocking(i2c, address, data, 2, false);
return (data[0] << 8) | data[1];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class VEML7700 {

void writeRegister(uint8_t reg, uint16_t value);
uint16_t readRegister(uint8_t reg);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ void satellite_functions::all_face_data(){
printf("Face %u Temperature: %.3fC\n", i, face_temps[i]);
printf("Face %u Light: %.3fLux\n", i, face_light[i]);
}
}
}
2 changes: 1 addition & 1 deletion PicoSDK/Batt_Pico_sdk/Battery_Software/lib/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ void maximum_power_operations(tools t, neopixel neo, satellite_functions functio
sleep_ms(1000);
functions.all_face_data();
//maybe consider tasking second core to stuff
}
}
2 changes: 1 addition & 1 deletion PicoSDK/Batt_Pico_sdk/Battery_Software/lib/main/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ void normal_power_operations(tools t, neopixel neo, satellite_functions function
void maximum_power_operations(tools t, neopixel neo, satellite_functions functions);


#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ class neopixel{
void put_pixel(int pixel_grb);
uint32_t urgb_u32(uint8_t r, uint8_t g, uint8_t b);
};
#endif
#endif
Loading
Loading