Skip to content

Commit

Permalink
fix some formatty things
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Apr 22, 2024
1 parent d611977 commit b704875
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class MotorInterruptHandler {
hardware.get_encoder_pulses();
#ifdef USE_PRESSURE_MOVE
if (buffered_move.sensor_id != can::ids::SensorId::UNUSED) {
uint8_t binding = static_cast<uint8_t>(0x3); // sync and report
auto binding = static_cast<uint8_t>(0x3); // sync and report
if (buffered_move.sensor_id == can::ids::SensorId::BOTH) {
send_bind_message(can::ids::SensorId::S0, binding);
send_bind_message(can::ids::SensorId::S1, binding);
Expand Down Expand Up @@ -499,7 +499,7 @@ class MotorInterruptHandler {
build_and_send_ack(ack_msg_id);
#ifdef USE_PRESSURE_MOVE
if (buffered_move.sensor_id != can::ids::SensorId::UNUSED) {
uint8_t binding =
auto binding =
static_cast<uint8_t>(can::ids::SensorOutputBinding::sync);
if (buffered_move.sensor_id == can::ids::SensorId::BOTH) {
send_bind_message(can::ids::SensorId::S0, binding);
Expand Down Expand Up @@ -656,15 +656,13 @@ class MotorInterruptHandler {
can::messages::BindSensorOutputRequest& m) {
std::ignore = sensor_tasks::get_queues()
.pressure_sensor_queue_rear->try_write_isr(m);
// if (!success) {this->cancel_and_clear_moves();}
}
void send_to_pressure_sensor_queue_front(
can::messages::BindSensorOutputRequest& m) {
// send to both queues, they will handle their own gating based on
// sensor id
std::ignore = sensor_tasks::get_queues()
.pressure_sensor_queue_front->try_write_isr(m);
// if (!success) {this->cancel_and_clear_moves();}
}
#endif
uint64_t tick_count = 0x0;
Expand Down
12 changes: 6 additions & 6 deletions push
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _build_fw(zip_path, apps_path):

def _transfer_firmware(host, repo_path, scp, ssh, sensors):
dist_dir = "dist"
if sensors
if sensors:
dist_dir = dist_dir+"-sensors"
apps_path = os.path.join(repo_path, 'dist-sensor', 'applications')
apps_path = os.path.join(repo_path, 'dist-sensor', 'applications')
Expand All @@ -76,11 +76,11 @@ def _transfer_firmware(host, repo_path, scp, ssh, sensors):
def _prep_firmware(repo_path, cmake, sensors):
preset = "firmware-g4"
working_dir = "./build-cross"
if sensors
if sensors:
preset = preset+"-sensors"
working_dir = working_dir+"-sensors"
_cmd([cmake, '--build', f'--preset={preset}', '--target', 'firmware-applications'], cwd=repo_path)
_cmd([cmake, '--install', f'{working_dir}', '--component', 'Applications'], cwd=repo_path)
_cmd([cmake, '--install', f'{working_dir}/', '--component', 'Applications'], cwd=repo_path)

@contextmanager
def _prep_robot(host, ssh):
Expand All @@ -105,7 +105,7 @@ def _find_utils():
def _restart_robot(host, ssh):
_ssh(ssh, host, 'nohup systemctl restart opentrons-robot-server &')

def _do_push(host, repo_path, build, restart):
def _do_push(host, repo_path, build, restart, sensors):
ssh, scp, cmake = _find_utils()
if build:
_prep_firmware(repo_path, cmake, sensors)
Expand All @@ -117,7 +117,7 @@ def _do_push(host, repo_path, build, restart):
def push(host, repo_path=None, build=True, restart=True, sensors=False):
repo = repo_path or os.dirname(__file__)
try:
_do_push(host, repo, build, restart)
_do_push(host, repo, build, restart, sensors)
return 0
except subprocess.CalledProcessError as e:
print(
Expand Down Expand Up @@ -167,7 +167,7 @@ def _arg_parser(parent=None):
)
parser.add_argument(
'--sensors',
type=str,
action='store_true',
help='Private SSH key to use'
)
return parser
Expand Down

0 comments on commit b704875

Please sign in to comment.