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

board: remove set_phone_power #1747

Merged
merged 1 commit into from
Nov 25, 2023
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion board/boards/black.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ const board board_black = {
.read_current = unused_read_current,
.set_fan_enabled = unused_set_fan_enabled,
.set_ir_power = unused_set_ir_power,
.set_phone_power = unused_set_phone_power,
.set_siren = unused_set_siren,
.read_som_gpio = unused_read_som_gpio
};
2 changes: 0 additions & 2 deletions board/boards/board_declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ typedef bool (*board_check_ignition)(void);
typedef uint32_t (*board_read_current)(void);
typedef void (*board_set_ir_power)(uint8_t percentage);
typedef void (*board_set_fan_enabled)(bool enabled);
typedef void (*board_set_phone_power)(bool enabled);
typedef void (*board_set_siren)(bool enabled);
typedef void (*board_set_bootkick)(BootState state);
typedef bool (*board_read_som_gpio)(void);
Expand All @@ -42,7 +41,6 @@ struct board {
board_read_current read_current;
board_set_ir_power set_ir_power;
board_set_fan_enabled set_fan_enabled;
board_set_phone_power set_phone_power;
board_set_siren set_siren;
board_set_bootkick set_bootkick;
board_read_som_gpio read_som_gpio;
Expand Down
1 change: 0 additions & 1 deletion board/boards/dos.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ const board board_dos = {
.read_current = unused_read_current,
.set_fan_enabled = dos_set_fan_enabled,
.set_ir_power = dos_set_ir_power,
.set_phone_power = unused_set_phone_power,
.set_siren = dos_set_siren,
.set_bootkick = dos_set_bootkick,
.read_som_gpio = dos_read_som_gpio
Expand Down
1 change: 0 additions & 1 deletion board/boards/grey.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const board board_grey = {
.read_current = white_read_current,
.set_fan_enabled = unused_set_fan_enabled,
.set_ir_power = unused_set_ir_power,
.set_phone_power = unused_set_phone_power,
.set_siren = unused_set_siren,
.read_som_gpio = unused_read_som_gpio
};
1 change: 0 additions & 1 deletion board/boards/pedal.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const board board_pedal = {
.read_current = unused_read_current,
.set_fan_enabled = unused_set_fan_enabled,
.set_ir_power = unused_set_ir_power,
.set_phone_power = unused_set_phone_power,
.set_siren = unused_set_siren,
.read_som_gpio = unused_read_som_gpio
};
1 change: 0 additions & 1 deletion board/boards/red.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ const board board_red = {
.read_current = unused_read_current,
.set_fan_enabled = unused_set_fan_enabled,
.set_ir_power = unused_set_ir_power,
.set_phone_power = unused_set_phone_power,
.set_siren = unused_set_siren,
.read_som_gpio = unused_read_som_gpio
};
1 change: 0 additions & 1 deletion board/boards/red_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const board board_red_v2 = {
.read_current = unused_read_current,
.set_fan_enabled = unused_set_fan_enabled,
.set_ir_power = unused_set_ir_power,
.set_phone_power = unused_set_phone_power,
.set_siren = unused_set_siren,
.read_som_gpio = unused_read_som_gpio
};
1 change: 0 additions & 1 deletion board/boards/tres.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ const board board_tres = {
.read_current = unused_read_current,
.set_fan_enabled = tres_set_fan_enabled,
.set_ir_power = tres_set_ir_power,
.set_phone_power = unused_set_phone_power,
.set_siren = fake_siren_set,
.set_bootkick = tres_set_bootkick,
.read_som_gpio = tres_read_som_gpio
Expand Down
7 changes: 1 addition & 6 deletions board/boards/uno.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ void uno_set_bootkick(BootState state) {
}
}

void uno_set_phone_power(bool enabled){
set_gpio_output(GPIOB, 4, enabled);
}

void uno_set_can_mode(uint8_t mode) {
uno_enable_can_transceiver(2U, false);
uno_enable_can_transceiver(4U, false);
Expand Down Expand Up @@ -141,7 +137,7 @@ void uno_init(void) {
set_gpio_alternate(GPIOC, 8, GPIO_AF2_TIM3);

// Turn on phone regulator
uno_set_phone_power(true);
set_gpio_output(GPIOB, 4, true);

// Initialize IR PWM and set to 0%
set_gpio_alternate(GPIOB, 7, GPIO_AF2_TIM4);
Expand Down Expand Up @@ -224,7 +220,6 @@ const board board_uno = {
.read_current = unused_read_current,
.set_fan_enabled = uno_set_fan_enabled,
.set_ir_power = uno_set_ir_power,
.set_phone_power = uno_set_phone_power,
.set_siren = unused_set_siren,
.set_bootkick = uno_set_bootkick,
.read_som_gpio = unused_read_som_gpio
Expand Down
4 changes: 0 additions & 4 deletions board/boards/unused_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ void unused_set_fan_enabled(bool enabled) {
UNUSED(enabled);
}

void unused_set_phone_power(bool enabled) {
UNUSED(enabled);
}

void unused_set_siren(bool enabled) {
UNUSED(enabled);
}
Expand Down
1 change: 0 additions & 1 deletion board/boards/white.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ const board board_white = {
.read_current = white_read_current,
.set_fan_enabled = unused_set_fan_enabled,
.set_ir_power = unused_set_ir_power,
.set_phone_power = unused_set_phone_power,
.set_siren = unused_set_siren,
.read_som_gpio = unused_read_som_gpio
};
4 changes: 0 additions & 4 deletions board/main_comms.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ int comms_control_handler(ControlPacket_t *req, uint8_t *resp) {
resp[1] = ((fan_state.rpm & 0xFF00U) >> 8U);
resp_len = 2;
break;
// **** 0xb3: set phone power
case 0xb3:
current_board->set_phone_power(req->param1 > 0U);
break;
// **** 0xc0: reset communications
case 0xc0:
comms_can_reset();
Expand Down
4 changes: 0 additions & 4 deletions python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,6 @@ def get_fan_rpm(self):
a = struct.unpack("H", dat)
return a[0]

# ****************** Phone *****************
def set_phone_power(self, enabled):
self._handle.controlWrite(Panda.REQUEST_OUT, 0xb3, int(enabled), 0, b'')

# ****************** Siren *****************
def set_siren(self, enabled):
self._handle.controlWrite(Panda.REQUEST_OUT, 0xf6, int(enabled), 0, b'')
Expand Down
Loading