Skip to content

Commit

Permalink
Code Review feedback corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
jdk-maxim committed Oct 2, 2024
1 parent c574d47 commit 036cc30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Libraries/PeriphDrivers/Source/AFE/afe.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

//
// Enabling this will use the afe timer to timeout polling of the AFE.
// This avoid any chance of the blocking function afe_spi_transceive from never returning.
// This avoids any chance of the blocking function afe_spi_transceive from never returning.
// However, as this low level function can be called several times for even a single
// AFE register read, it decreases throughput to and from the AFE.
// When running at lower system clock frequencies this can be more of a concern.
Expand Down Expand Up @@ -524,7 +524,7 @@ static int afe_spi_transceive(uint8_t *data, int byte_length)
#else // Not AFE_SPI_TRANSCEIVE_SAFE_BUT_SLOWER

//
// This function blocks until transceive is completed, or times out
// This function blocks until transceive is completed
// This version does not use the afe timer to interrupt potential infinite polling.
//
static int afe_spi_transceive(uint8_t *data, int byte_length)
Expand Down
11 changes: 7 additions & 4 deletions Libraries/PeriphDrivers/Source/AFE/hart_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ static int hart_uart_pins_external_test_mode_state(void)
int retval = 0;
mxc_gpio_cfg_t hart_pin;

// RTS Input to AFE, LOW is transmit mode, so Pulling Up
// HART_RTS Input to AFE, LOW is transmit mode, so Pulling Up
hart_pin.port = HART_RTS_GPIO_PORT;
hart_pin.mask = HART_RTS_GPIO_PIN;
hart_pin.pad = MXC_GPIO_PAD_PULL_UP;
Expand All @@ -498,30 +498,33 @@ static int hart_uart_pins_external_test_mode_state(void)
return retval;
}

// CD output from AFE, Tristate
// HART_CD output from AFE, Tristate
hart_pin.port = HART_CD_GPIO_PORT;
hart_pin.mask = HART_CD_GPIO_PIN;
hart_pin.pad = MXC_GPIO_PAD_NONE;
hart_pin.func = MXC_GPIO_FUNC_IN;

retval = MXC_AFE_GPIO_Config(&hart_pin);
if (retval != E_NO_ERROR) {
return retval;
}

// IN input to AFE, pulling Up
// HART_IN input to AFE, pulling Up
hart_pin.port = HART_IN_GPIO_PORT;
hart_pin.mask = HART_IN_GPIO_PIN;
hart_pin.pad = MXC_GPIO_PAD_PULL_UP;
hart_pin.func = MXC_GPIO_FUNC_IN;

retval = MXC_AFE_GPIO_Config(&hart_pin);
if (retval != E_NO_ERROR) {
return retval;
}

// IN output from AFE, Tristate
// HART_OUT output from AFE, Tristate
hart_pin.port = HART_OUT_GPIO_PORT;
hart_pin.mask = HART_OUT_GPIO_PIN;
hart_pin.pad = MXC_GPIO_PAD_NONE;
hart_pin.func = MXC_GPIO_FUNC_IN;

retval = MXC_AFE_GPIO_Config(&hart_pin);
if (retval != E_NO_ERROR) {
Expand Down

0 comments on commit 036cc30

Please sign in to comment.