Skip to content

Commit a06fe58

Browse files
liuchaojudecumt
authored andcommitted
fix serial dma rx ringbuffer position mismatch
1 parent d23006e commit a06fe58

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/drivers/include/ipc/ringbuffer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ struct rt_ringbuffer
4141
* read_idx-^ ^-write_idx
4242
*/
4343

44-
rt_uint32_t read_mirror : 1;
45-
rt_uint32_t read_index : 31;
46-
rt_uint32_t write_mirror : 1;
47-
rt_uint32_t write_index : 31;
44+
volatile rt_uint32_t read_mirror : 1;
45+
volatile rt_uint32_t read_index : 31;
46+
volatile rt_uint32_t write_mirror : 1;
47+
volatile rt_uint32_t write_index : 31;
4848
/* as we use msb of index as mirror bit, the size should be signed and
4949
* could only be positive. */
5050
rt_int32_t buffer_size;

0 commit comments

Comments
 (0)