Skip to content

nrf52 - fix i2c/twi driver #11676

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

Merged
merged 1 commit into from
Oct 15, 2019
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
NRF_GPIO_PIN_S0D1, \
NRF_GPIO_PIN_NOSENSE)

#define HW_TIMEOUT 10000
#define HW_TIMEOUT 100000

// Control block - driver instance local data.
typedef struct
Expand All @@ -93,13 +93,13 @@ typedef struct
nrfx_twi_xfer_desc_t xfer_desc;
uint32_t flags;
uint8_t * p_curr_buf;
uint8_t curr_length;
size_t curr_length;
bool curr_no_stop;
nrfx_drv_state_t state;
bool error;
volatile bool busy;
bool repeated;
uint8_t bytes_transferred;
size_t bytes_transferred;
bool hold_bus_uninit;
} twi_control_block_t;

Expand Down Expand Up @@ -254,8 +254,8 @@ void nrfx_twi_disable(nrfx_twi_t const * p_instance)

static bool twi_send_byte(NRF_TWI_Type * p_twi,
uint8_t const * p_data,
uint8_t length,
uint8_t * p_bytes_transferred,
size_t length,
size_t * p_bytes_transferred,
bool no_stop)
{
if (*p_bytes_transferred < length)
Expand All @@ -280,8 +280,8 @@ static bool twi_send_byte(NRF_TWI_Type * p_twi,

static void twi_receive_byte(NRF_TWI_Type * p_twi,
uint8_t * p_data,
uint8_t length,
uint8_t * p_bytes_transferred)
size_t length,
size_t * p_bytes_transferred)
{
if (*p_bytes_transferred < length)
{
Expand All @@ -304,9 +304,9 @@ static void twi_receive_byte(NRF_TWI_Type * p_twi,

static bool twi_transfer(NRF_TWI_Type * p_twi,
bool * p_error,
uint8_t * p_bytes_transferred,
size_t * p_bytes_transferred,
uint8_t * p_data,
uint8_t length,
size_t length,
bool no_stop)
{
bool do_stop_check = ((*p_error) || ((*p_bytes_transferred) == length));
Expand Down Expand Up @@ -376,7 +376,7 @@ static bool twi_transfer(NRF_TWI_Type * p_twi,
static nrfx_err_t twi_tx_start_transfer(twi_control_block_t * p_cb,
NRF_TWI_Type * p_twi,
uint8_t const * p_data,
uint8_t length,
size_t length,
bool no_stop)
{
nrfx_err_t ret_code = NRFX_SUCCESS;
Expand Down Expand Up @@ -444,7 +444,7 @@ static nrfx_err_t twi_tx_start_transfer(twi_control_block_t * p_cb,
static nrfx_err_t twi_rx_start_transfer(twi_control_block_t * p_cb,
NRF_TWI_Type * p_twi,
uint8_t const * p_data,
uint8_t length)
size_t length)
{
nrfx_err_t ret_code = NRFX_SUCCESS;
volatile int32_t hw_timeout;
Expand Down