Skip to content

Commit

Permalink
jungle: fix transceiver typo (#2133)
Browse files Browse the repository at this point in the history
jungle: transceiver typo
  • Loading branch information
sshane authored Jan 29, 2025
1 parent d75e4ee commit edf0428
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions board/jungle/boards/board_declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ typedef void (*board_set_ignition)(bool enabled);
typedef void (*board_set_individual_ignition)(uint8_t bitmask);
typedef void (*board_set_harness_orientation)(uint8_t orientation);
typedef void (*board_set_can_mode)(uint8_t mode);
typedef void (*board_enable_can_transciever)(uint8_t transciever, bool enabled);
typedef void (*board_enable_can_transceiver)(uint8_t transceiver, bool enabled);
typedef void (*board_enable_header_pin)(uint8_t pin_num, bool enabled);
typedef float (*board_get_channel_power)(uint8_t channel);
typedef uint16_t (*board_get_sbu_mV)(uint8_t channel, uint8_t sbu);
Expand All @@ -28,7 +28,7 @@ struct board {
board_set_individual_ignition set_individual_ignition;
board_set_harness_orientation set_harness_orientation;
board_set_can_mode set_can_mode;
board_enable_can_transciever enable_can_transciever;
board_enable_can_transceiver enable_can_transceiver;
board_enable_header_pin enable_header_pin;
board_get_channel_power get_channel_power;
board_get_sbu_mV get_sbu_mV;
Expand Down
20 changes: 10 additions & 10 deletions board/jungle/boards/board_v1.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ void board_v1_set_led(uint8_t color, bool enabled) {
}
}

void board_v1_enable_can_transciever(uint8_t transciever, bool enabled) {
switch (transciever) {
void board_v1_enable_can_transceiver(uint8_t transceiver, bool enabled) {
switch (transceiver) {
case 1U:
set_gpio_output(GPIOC, 1, !enabled);
break;
Expand All @@ -33,14 +33,14 @@ void board_v1_enable_can_transciever(uint8_t transciever, bool enabled) {
set_gpio_output(GPIOB, 10, !enabled);
break;
default:
print("Invalid CAN transciever ("); puth(transciever); print("): enabling failed\n");
print("Invalid CAN transceiver ("); puth(transceiver); print("): enabling failed\n");
break;
}
}

void board_v1_set_can_mode(uint8_t mode) {
board_v1_enable_can_transciever(2U, false);
board_v1_enable_can_transciever(4U, false);
board_v1_enable_can_transceiver(2U, false);
board_v1_enable_can_transceiver(4U, false);
switch (mode) {
case CAN_MODE_NORMAL:
print("Setting normal CAN mode\n");
Expand All @@ -52,7 +52,7 @@ void board_v1_set_can_mode(uint8_t mode) {
set_gpio_alternate(GPIOB, 5, GPIO_AF9_CAN2);
set_gpio_alternate(GPIOB, 6, GPIO_AF9_CAN2);
can_mode = CAN_MODE_NORMAL;
board_v1_enable_can_transciever(2U, true);
board_v1_enable_can_transceiver(2U, true);
break;
case CAN_MODE_OBD_CAN2:
print("Setting OBD CAN mode\n");
Expand All @@ -64,7 +64,7 @@ void board_v1_set_can_mode(uint8_t mode) {
set_gpio_alternate(GPIOB, 12, GPIO_AF9_CAN2);
set_gpio_alternate(GPIOB, 13, GPIO_AF9_CAN2);
can_mode = CAN_MODE_OBD_CAN2;
board_v1_enable_can_transciever(4U, true);
board_v1_enable_can_transceiver(4U, true);
break;
default:
print("Tried to set unsupported CAN mode: "); puth(mode); print("\n");
Expand Down Expand Up @@ -135,9 +135,9 @@ void board_v1_init(void) {

board_v1_set_can_mode(CAN_MODE_NORMAL);

// Enable CAN transcievers
// Enable CAN transceivers
for(uint8_t i = 1; i <= 4; i++) {
board_v1_enable_can_transciever(i, true);
board_v1_enable_can_transceiver(i, true);
}

// Disable LEDs
Expand Down Expand Up @@ -171,7 +171,7 @@ board board_v1 = {
.set_individual_ignition = &unused_set_individual_ignition,
.set_harness_orientation = &board_v1_set_harness_orientation,
.set_can_mode = &board_v1_set_can_mode,
.enable_can_transciever = &board_v1_enable_can_transciever,
.enable_can_transceiver = &board_v1_enable_can_transceiver,
.enable_header_pin = &unused_board_enable_header_pin,
.get_channel_power = &board_v1_get_channel_power,
.get_sbu_mV = &board_v1_get_sbu_mV,
Expand Down
20 changes: 10 additions & 10 deletions board/jungle/boards/board_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ void board_v2_set_harness_orientation(uint8_t orientation) {
}
}

void board_v2_enable_can_transciever(uint8_t transciever, bool enabled) {
switch (transciever) {
void board_v2_enable_can_transceiver(uint8_t transceiver, bool enabled) {
switch (transceiver) {
case 1U:
set_gpio_output(GPIOG, 11, !enabled);
break;
Expand All @@ -125,7 +125,7 @@ void board_v2_enable_can_transciever(uint8_t transciever, bool enabled) {
set_gpio_output(GPIOB, 4, !enabled);
break;
default:
print("Invalid CAN transciever ("); puth(transciever); print("): enabling failed\n");
print("Invalid CAN transceiver ("); puth(transceiver); print("): enabling failed\n");
break;
}
}
Expand All @@ -139,8 +139,8 @@ void board_v2_enable_header_pin(uint8_t pin_num, bool enabled) {
}

void board_v2_set_can_mode(uint8_t mode) {
board_v2_enable_can_transciever(2U, false);
board_v2_enable_can_transciever(4U, false);
board_v2_enable_can_transceiver(2U, false);
board_v2_enable_can_transceiver(4U, false);
switch (mode) {
case CAN_MODE_NORMAL:
// B12,B13: disable normal mode
Expand All @@ -157,7 +157,7 @@ void board_v2_set_can_mode(uint8_t mode) {
set_gpio_pullup(GPIOB, 6, PULL_NONE);
set_gpio_alternate(GPIOB, 6, GPIO_AF9_FDCAN2);
can_mode = CAN_MODE_NORMAL;
board_v2_enable_can_transciever(2U, true);
board_v2_enable_can_transceiver(2U, true);
break;
case CAN_MODE_OBD_CAN2:
// B5,B6: disable normal mode
Expand All @@ -173,7 +173,7 @@ void board_v2_set_can_mode(uint8_t mode) {
set_gpio_pullup(GPIOB, 13, PULL_NONE);
set_gpio_alternate(GPIOB, 13, GPIO_AF9_FDCAN2);
can_mode = CAN_MODE_OBD_CAN2;
board_v2_enable_can_transciever(4U, true);
board_v2_enable_can_transceiver(4U, true);
break;
default:
break;
Expand Down Expand Up @@ -260,9 +260,9 @@ void board_v2_init(void) {
// Normal CAN mode
board_v2_set_can_mode(CAN_MODE_NORMAL);

// Enable CAN transcievers
// Enable CAN transceivers
for(uint8_t i = 1; i <= 4; i++) {
board_v2_enable_can_transciever(i, true);
board_v2_enable_can_transceiver(i, true);
}

// Set to no harness orientation
Expand Down Expand Up @@ -321,7 +321,7 @@ board board_v2 = {
.set_individual_ignition = &board_v2_set_individual_ignition,
.set_harness_orientation = &board_v2_set_harness_orientation,
.set_can_mode = &board_v2_set_can_mode,
.enable_can_transciever = &board_v2_enable_can_transciever,
.enable_can_transceiver = &board_v2_enable_can_transceiver,
.enable_header_pin = &board_v2_enable_header_pin,
.get_channel_power = &board_v2_get_channel_power,
.get_sbu_mV = &board_v2_get_sbu_mV,
Expand Down
2 changes: 1 addition & 1 deletion board/jungle/main_comms.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ int comms_control_handler(ControlPacket_t *req, uint8_t *resp) {
break;
// **** 0xf4: Set CAN transceiver enable pin
case 0xf4:
current_board->enable_can_transciever(req->param1, req->param2 > 0U);
current_board->enable_can_transceiver(req->param1, req->param2 > 0U);
break;
// **** 0xf5: Set CAN silent mode
case 0xf5:
Expand Down

0 comments on commit edf0428

Please sign in to comment.