Skip to content

Commit 4236cd5

Browse files
committed
Make Vring configurable
1 parent 33e4ed4 commit 4236cd5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cores/arduino/stm32/OpenAMP/virtio_config.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
// Size of buffer of each vring buffers
55
#ifdef RPMSG_BUFFER_SIZE
6-
#error "RPMSG_BUFFER_SIZE should be aligned with the kernel definition."
7-
#error "Reference: https://elixir.bootlin.com/linux/v5.5.2/source/drivers/rpmsg/virtio_rpmsg_bus.c#L137"
6+
#warning "RPMSG_BUFFER_SIZE should be aligned with the kernel definition."
7+
#warning "Reference: https://elixir.bootlin.com/linux/v5.5.2/source/drivers/rpmsg/virtio_rpmsg_bus.c#L137"
88
#else
99
#define RPMSG_BUFFER_SIZE (512)
1010
#endif
@@ -20,7 +20,9 @@
2020
* A buffer handles VirtIOSerial::rxCallback() requires to be
2121
* (RPMSG_VRING_PAYLOAD_SIZE * VRING_NUM_BUFFS) at minimum to prevent overflow.
2222
*/
23-
#define VRING_NUM_BUFFS 16
23+
#ifndef VRING_NUM_BUFFS
24+
#define VRING_NUM_BUFFS (16)
25+
#endif
2426
#define RPMSG_VRING_TOTAL_PAYLOAD_SIZE (RPMSG_VRING_PAYLOAD_SIZE * VRING_NUM_BUFFS)
2527

2628
#if defined (VIRTIO_LOG)

0 commit comments

Comments
 (0)