Skip to content

Commit 601bc87

Browse files
committed
Merge branch 'develop'
2 parents 695cd91 + d90d842 commit 601bc87

26 files changed

+186
-28
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
author = 'Tilen MAJERLE'
2828

2929
# The full version, including alpha/beta/rc tags
30-
version = '2.0.0'
30+
version = '2.0.1'
3131

3232
# Try to get branch at which this is running
3333
# and try to determine which version to display in sphinx

docs/examples_src/example_advance_1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Declare buffer variables */
1+
/* Declare rb instance & raw data */
22
lwrb_t buff;
33
uint8_t buff_data[8];
44

docs/examples_src/example_advance_2.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include "lwrb/lwrb.h"
22

3-
/* Buffer variables */
4-
lwrb_t buff; /* Declare ring buffer structure */
5-
uint8_t buff_data[8]; /* Declare raw buffer data array */
3+
/* Declare rb instance & raw data */
4+
lwrb_t buff;
5+
uint8_t buff_data[8];
66

7-
/* Application variables
8-
uint8_t data[2]; /* Application working data */
7+
/* Application variables */
8+
uint8_t data[2];
99

1010
/* Application code ... */
1111
lwrb_init(&buff, buff_data, sizeof(buff_data)); /* Initialize buffer */

docs/examples_src/example_dma_skip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Buffer */
1+
/* Declare rb instance & raw data */
22
lwrb_t buff;
33
uint8_t buff_data[8];
44

docs/examples_src/example_index.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/* Buffer variables */
2-
lwrb_t buff; /* Declare ring buffer structure */
3-
uint8_t buff_data[8]; /* Declare raw buffer data array */
1+
/* Declare rb instance & raw data */
2+
lwrb_t buff;
3+
uint8_t buff_data[8];
44

55
/* Application variables */
6-
uint8_t data[2]; /* Application working data */
6+
uint8_t data[2];
77
size_t len;
88

99
/* Application code ... */

docs/examples_src/example_minimal.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include "lwrb/lwrb.h"
22

3-
/* Buffer variables */
4-
lwrb_t buff; /* Declare ring buffer structure */
5-
uint8_t buff_data[8]; /* Declare raw buffer data array */
3+
/* Declare rb instance & raw data */
4+
lwrb_t buff;
5+
uint8_t buff_data[8];
66

7-
/* Application variables
8-
uint8_t data[2]; /* Application working data */
7+
/* Application variables */
8+
uint8_t data[2]; /* Application working data */
99

1010
/* Application code ... */
1111
lwrb_init(&buff, buff_data, sizeof(buff_data)); /* Initialize buffer */

docs/examples_src/example_skip_1.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
21
#include "lwrb/lwrb.h"
32

4-
/* Declare buffer variables */
3+
/* Declare rb instance & raw data */
54
lwrb_t buff;
65
uint8_t buff_data[8];
76

docs/examples_src/example_skip_2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/* Initialization part skipped */
22

33
/* Get length of linear memory at read pointer */
4-
/* When function returns 0, there is no memory available in the buffer for read anymore */
4+
/* When function returns 0, there is no memory
5+
available in the buffer for read anymore */
56
while ((len = lwrb_get_linear_block_read_length(&buff)) > 0) {
67
/* Get pointer to first element in linear block at read address */
78
data = lwrb_get_linear_block_read_address(&buff);
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* Declare variables */
2+
lwrb_t rb;
3+
4+
/* 2 mutexes, one for write operations,
5+
one for read operations */
6+
mutex_t m_w, m_r;
7+
8+
/* 4 threads below, 2 for write, 2 for read */
9+
void
10+
thread_write_1(void* arg) {
11+
/* Use write mutex */
12+
while (1) {
13+
mutex_get(&m_w);
14+
lwrb_write(&rb, ...);
15+
mutex_give(&m_w);
16+
}
17+
}
18+
19+
void
20+
thread_write_2(void* arg) {
21+
/* Use write mutex */
22+
while (1) {
23+
mutex_get(&m_w);
24+
lwrb_write(&rb, ...);
25+
mutex_give(&m_w);
26+
}
27+
}
28+
29+
void
30+
thread_read_1(void* arg) {
31+
/* Use read mutex */
32+
while (1) {
33+
mutex_get(&m_r);
34+
lwrb_read(&rb, ...);
35+
mutex_give(&m_r);
36+
}
37+
}
38+
39+
void
40+
thread_read_2(void* arg) {
41+
/* Use read mutex */
42+
while (1) {
43+
mutex_get(&m_r);
44+
lwrb_read(&rb, ...);
45+
mutex_give(&m_r);
46+
}
47+
}

docs/examples_src/example_tt_buff_size.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ uint32_t d[2];
1111
lwrb_t buff_1;
1212
lwrb_t buff_2;
1313

14-
/* Create data for buffers. Use sizeof structure, multiplied by N (for N instances) */
14+
/* Create data for buffers. Use sizeof structure,
15+
multiplied by N (for N instances) */
1516
/* Buffer with + 1 bytes bigger memory */
1617
uint8_t buff_data_1[sizeof(d) * N + 1];
1718
/* Buffer without + 1 at the end */

0 commit comments

Comments
 (0)