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

🔖 Release 3.3.3 #215

Merged
merged 24 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2c9c6b9
Merge pull request #185 from purduesigbots/master
kunwarsahni01 Nov 19, 2021
2a9b75e
🐛 emit correct compiler for C files when generating CDB (#188)
HotelCalifornia Dec 21, 2021
406217a
Update Azure Pipelines with new self hosted M1 Mac (#189)
kunwarsahni01 Dec 31, 2021
16285eb
Update azure-pipelines.yml
kunwarsahni01 Dec 31, 2021
8726dbb
Update azure-pipelines.yml for Azure Pipelines
kunwarsahni01 Dec 31, 2021
54949c7
Update azure-pipelines.yml for Azure Pipelines
kunwarsahni01 Dec 31, 2021
cc61aa3
Fixes 'make.exe.exe' typo. Adds disable sentry prompt option for VSCo…
BennyBot Jan 17, 2022
a7a6c80
Update Version (#186) (#191)
kunwarsahni01 Jan 17, 2022
851efc3
✨Add Analytics (#193)
BennyBot Feb 2, 2022
888894d
✨More Upload Options (#194)
BennyBot Feb 2, 2022
57d2b35
Update Version (#186) (#195)
kunwarsahni01 Feb 2, 2022
32c41c1
Merge pull request #196 from purduesigbots/master
kunwarsahni01 Feb 2, 2022
949ee7d
Resolve Backmerge Conflicts
BennyBot Feb 22, 2022
4b80202
Add __init__ file so ga is considered a module (#206)
BennyBot Mar 7, 2022
44181d9
Fix issue with programs uploading segfaulting/NACKing/doing nothing (…
BennyBot Mar 17, 2022
62ee4b8
✨Set team number and robot name (#210)
BennyBot May 18, 2022
7406558
Add m as an alias for pros make. (#204)
BennyBot May 18, 2022
efc2bb6
Cleaned Up CI (#213)
kunwarsahni01 May 18, 2022
e4a7f66
Revert "✨Set team number and robot name (#210)" (#214)
BennyBot May 23, 2022
b3ca101
Update Version to 3.3.3
BennyBot May 23, 2022
3208f60
Merge pull request #216 from purduesigbots/master
BennyBot May 24, 2022
162a5e8
Update Version to 3.3.3
BennyBot May 23, 2022
9693787
Merge remote-tracking branch 'origin/release/3.3.3' into release/3.3.3
BennyBot May 24, 2022
8f0cdf8
Revert kernel variable read/set
BennyBot May 24, 2022
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
42 changes: 14 additions & 28 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ jobs:

- job: Windows
dependsOn: UpdateBuildNumber
timeoutInMinutes: 30
timeoutInMinutes: 20
strategy:
maxParallel: 2
matrix:
x64:
buildArch: x64
x86:
buildArch: x86
pool:
vmImage: windows-latest
steps:
Expand All @@ -33,7 +31,7 @@ jobs:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python.version)
architecture: $(buildArch)
# architecture: $(buildArch)
- powershell: scripts/build.ps1
displayName: Build
- task: PublishPipelineArtifact@0
Expand All @@ -42,37 +40,22 @@ jobs:
targetPath: 'out'

- job: macOS
timeoutInMinutes: 30
timeoutInMinutes: 20
dependsOn: UpdateBuildNumber
strategy:
maxParallel: 2
matrix:
x64:
poolName: Azure Pipelines
vmImage: macos-latest
buildArch: x64
pool:
vmImage: macos-latest
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python.version)
architecture: $(buildArch)
- bash: scripts/build.sh
displayName: Build
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'pros_cli-$(Build.BuildNumber)-macos-$(buildArch)'
targetPath: 'out'

- job: macOSM1
timeoutInMinutes: 30
dependsOn: UpdateBuildNumber
strategy:
maxParallel: 2
matrix:
arm64:
poolName: M1 Mac
vmImage:
buildArch: arm64
pool:
M1 Mac
name: $(poolName)
vmImage: $(vmImage)
steps:
- task: UsePythonVersion@0
inputs:
Expand All @@ -85,21 +68,24 @@ jobs:
artifactName: 'pros_cli-$(Build.BuildNumber)-macos-$(buildArch)'
targetPath: 'out'


- job: Linux
timeoutInMinutes: 30
timeoutInMinutes: 20
dependsOn: UpdateBuildNumber
strategy:
maxParallel: 2
matrix:
x64:
buildArch: x64
arm64:
buildArch: arm64
pool:
vmImage: ubuntu-latest
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python.version)
architecture: $(buildArch)
# architecture: $(buildArch)
- bash: scripts/build.sh
displayName: Build
- task: PublishPipelineArtifact@0
Expand Down
2 changes: 1 addition & 1 deletion pip_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.2
3.3.3
1 change: 0 additions & 1 deletion pros/cli/misc_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from pros.cli.common import *
from pros.ga.analytics import analytics


@pros_root
def misc_commands_cli():
pass
Expand Down
32 changes: 0 additions & 32 deletions pros/cli/v5_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,35 +290,3 @@ def capture(file_name: str, port: str, force: bool = False):
w.write(file_, i_data)

print(f'Saved screen capture to {file_name}')

@v5.command(aliases=['sv', 'set'], short_help='Set a kernel variable on a connected V5 device')
@click.argument('variable', type=click.Choice(['teamnumber', 'robotname']), required=True)
@click.argument('value', required=True, type=click.STRING, nargs=1)
@default_options
def set_variable(variable, value):
import pros.serial.devices.vex as vex
from pros.serial.ports import DirectPort

# Get the connected v5 device
port = resolve_v5_port(None, 'system')[0]
if port == None:
return
device = vex.V5Device(DirectPort(port))
device.kv_write(variable, value)
print(f'{variable} set to {value[:253]}')

@v5.command(aliases=['rv', 'get'], short_help='Read a kernel variable from a connected V5 device')
@click.argument('variable', type=click.Choice(['teamnumber', 'robotname']), required=True)
@default_options
def read_variable(variable):
import pros.serial.devices.vex as vex
from pros.serial.ports import DirectPort

# Get the connected v5 device
port = resolve_v5_port(None, 'system')[0]
if port == None:
return
device = vex.V5Device(DirectPort(port))
value = device.kv_read(variable).decode()
print(f'Value of \'{variable}\' : {value}')

41 changes: 3 additions & 38 deletions pros/serial/devices/vex/v5_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,36 +892,6 @@ def sc_init(self) -> None:
self._txrx_ext_struct(0x28, [], '')
logger(__name__).debug('Completed ext 0x28 command')

@retries
def kv_read(self, kv: str) -> bytearray:
logger(__name__).debug('Sending ext 0x2e command')
encoded_kv = f'{kv}\0'.encode(encoding='ascii')
tx_payload = struct.pack(f'<{len(encoded_kv)}s', encoded_kv)
# Because the length of the kernel variables is not known, use None to indicate we are recieving an unknown length.
ret = self._txrx_ext_struct(0x2e, tx_payload, None, check_length=False, check_ack=True)[0]
logger(__name__).debug('Completed ext 0x2e command')
return ret

@retries
def kv_write(self, kv: str, payload: Union[Iterable, bytes, bytearray, str]):
logger(__name__).debug('Sending ext 0x2f command')
encoded_kv = f'{kv}\0'.encode(encoding='ascii')
kv_to_max_bytes = {
'teamnumber': 7,
'robotname': 16
}
if len(kv) > kv_to_max_bytes.get(kv, 254):
logger(__name__).info(f'{kv} is longer than the maximum supported length {kv_to_max_bytes[kv]}, truncating.')
# Trim down size of payload to fit within the 255 byte limit and add null terminator.
payload = payload[:kv_to_max_bytes.get(kv, 254)] + "\0"
if isinstance(payload, str):
payload = payload.encode(encoding='ascii')
tx_fmt =f'<{len(encoded_kv)}s{len(payload)}s'
tx_payload = struct.pack(tx_fmt, encoded_kv, payload)
ret = self._txrx_ext_packet(0x2f, tx_payload, None, check_length=False, check_ack=True)
logger(__name__).debug('Completed ext 0x2f command')
return ret

def _txrx_ext_struct(self, command: int, tx_data: Union[Iterable, bytes, bytearray],
unpack_fmt: str, check_length: bool = True, check_ack: bool = True,
timeout: Optional[float] = None) -> Tuple:
Expand All @@ -936,14 +906,10 @@ def _txrx_ext_struct(self, command: int, tx_data: Union[Iterable, bytes, bytearr
:param check_ack: If true, then checks the first byte of the extended payload as an AK byte
:return: A tuple unpacked according to the unpack_fmt
"""
# Calculate the size of unpack_fmt if it is not None
calculated_size = struct.calcsize(unpack_fmt) if unpack_fmt else None
rx = self._txrx_ext_packet(command, tx_data, calculated_size,
rx = self._txrx_ext_packet(command, tx_data, struct.calcsize(unpack_fmt),
check_length=check_length, check_ack=check_ack, timeout=timeout)
logger(__name__).debug('Unpacking with format: {}'.format(unpack_fmt))
# Use the provided unpack_fmt if it was not None, otherwise use the recieved size
recieve_format = unpack_fmt if unpack_fmt else '<{}s'.format(len(rx))
return struct.unpack(recieve_format, rx)
return struct.unpack(unpack_fmt, rx)

@classmethod
def _rx_ext_packet(cls, msg: Message, command: int, rx_length: int, check_ack: bool = True,
Expand Down Expand Up @@ -1006,8 +972,7 @@ def _txrx_ext_packet(self, command: int, tx_data: Union[Iterable, bytes, bytearr
"""
tx_payload = self._form_extended_payload(command, tx_data)
rx = self._txrx_packet(0x56, tx_data=tx_payload, timeout=timeout)
# Use rx_length if it was provided, otherwise use the length of the received data
rx_length = rx_length if rx_length else len(rx)

return self._rx_ext_packet(rx, command, rx_length, check_ack=check_ack, check_length=check_length)

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.2
3.3.3
2 changes: 1 addition & 1 deletion win_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.2.0
3.3.3.0