Skip to content

Commit

Permalink
nrfx_uarte: Make uarte_control_block_t's tx_buffer_length volatile
Browse files Browse the repository at this point in the history
In certain cases nrfx_uarte_tx_in_progress() needs to always return true. Such
behavior was observed when nrfx was compiled with strong optimizations (-O3).

Marking tx_buffer_length as volatile solved the problem.

Tested on Linux with arm-none-eabi-gcc v8.2.0
  • Loading branch information
goofacz authored and kl-cruz committed Jan 17, 2019
1 parent 2f4572b commit 7c070a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/src/nrfx_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ typedef struct
uint8_t const * p_tx_buffer;
uint8_t * p_rx_buffer;
uint8_t * p_rx_secondary_buffer;
size_t tx_buffer_length;
volatile size_t tx_buffer_length;
size_t rx_buffer_length;
size_t rx_secondary_buffer_length;
nrfx_drv_state_t state;
Expand Down

0 comments on commit 7c070a4

Please sign in to comment.