Skip to content

Commit b1bc859

Browse files
committed
Fix some compile warnings
1 parent f81a5dd commit b1bc859

File tree

4 files changed

+12
-50
lines changed

4 files changed

+12
-50
lines changed

cores/arduino/VirtIOSerial.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ int VirtIOSerial::read(void)
128128
size_t VirtIOSerial::readBytes(char *buffer, size_t length)
129129
{
130130
checkMessageFromISR();
131-
uint16_t prev_write_available = virtio_buffer_write_available(&_VirtIOSerialObj.ring);
132131
const size_t size = virtio_buffer_read(&_VirtIOSerialObj.ring, reinterpret_cast<uint8_t *>(buffer), length);
133132
// The ring buffer might be available enough to write after reading
134133
checkMessageFromISR();

cores/arduino/stm32/OpenAMP/mbox_ipcc.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333

3434
/* Includes ------------------------------------------------------------------*/
3535
#include "virtio_config.h"
36-
#include "openamp/open_amp.h"
36+
#include <openamp/open_amp.h>
3737
#include "stm32_def.h"
3838
#include "openamp_conf.h"
39+
#include "mbox_ipcc.h"
3940
#include "core_debug.h"
4041

4142
/* Private define ------------------------------------------------------------*/
@@ -103,6 +104,7 @@ int MAILBOX_Poll(struct virtio_device *vdev, uint32_t vring_id)
103104
switch (vring_id) {
104105
case VRING0_ID:
105106
if (msg_received_ch1 == RX_BUF_FREE) {
107+
core_debug("Running vring0 (ch_1 buf free)\n");
106108
/* This calls rpmsg_virtio_tx_callback(), which actually does nothing. */
107109
rproc_virtio_notified(vdev, VRING0_ID);
108110
msg_received_ch1 = RX_NO_MSG;
@@ -111,6 +113,7 @@ int MAILBOX_Poll(struct virtio_device *vdev, uint32_t vring_id)
111113
break;
112114
case VRING1_ID:
113115
if (msg_received_ch2 == RX_NEW_MSG) {
116+
core_debug("Running vring1 (ch_2 new msg)\n");
114117
/**
115118
* This calls rpmsg_virtio_rx_callback(), which calls virt_uart rx callback
116119
* RING_NUM_BUFFS times at maximum.
@@ -139,8 +142,8 @@ int MAILBOX_Poll(struct virtio_device *vdev, uint32_t vring_id)
139142
*/
140143
int MAILBOX_Notify(void *priv, uint32_t vring_id)
141144
{
142-
uint32_t channel;
143145
(void)priv;
146+
uint32_t channel;
144147

145148
/* Called after virtqueue processing: time to inform the remote */
146149
if (vring_id == VRING0_ID) {
@@ -170,6 +173,7 @@ int MAILBOX_Notify(void *priv, uint32_t vring_id)
170173
void IPCC_channel1_callback(IPCC_HandleTypeDef *hipcc,
171174
uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir)
172175
{
176+
(void) ChannelDir;
173177
msg_received_ch1 = RX_BUF_FREE;
174178

175179
/* Inform A7 that we have received the 'buff free' msg */
@@ -180,6 +184,7 @@ void IPCC_channel1_callback(IPCC_HandleTypeDef *hipcc,
180184
void IPCC_channel2_callback(IPCC_HandleTypeDef *hipcc,
181185
uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir)
182186
{
187+
(void) ChannelDir;
183188
msg_received_ch2 = RX_NEW_MSG;
184189

185190
/* Don't inform A7 here */

cores/arduino/stm32/OpenAMP/openamp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "rsc_table.h"
2525
#include "metal/sys.h"
2626
#include "metal/device.h"
27+
#include "mbox_ipcc.h"
2728
/* Private define ------------------------------------------------------------*/
2829

2930
#define SHM_DEVICE_NAME "STM32_SHM"

cores/arduino/stm32/OpenAMP/openamp_conf.h

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,59 +23,16 @@
2323

2424
#ifdef VIRTIOCON
2525

26-
/**
27-
* Note: Do not remove this. Removing this might not trigger compile error but
28-
* the configuration can be significantly different.
29-
*/
30-
#include "virtio_config.h"
31-
3226
#ifdef __cplusplus
3327
extern "C" {
3428
#endif
3529

36-
/* Includes ------------------------------------------------------------------*/
37-
/* ########################## Mailbox Interface Selection ############################## */
3830
/**
39-
* @brief This is the list of Mailbox interface to be used in the OpenAMP MW
40-
* Please note that not all interfaces are supported by a STM32 device
41-
*/
42-
#define MAILBOX_IPCC_IF_ENABLED
43-
//#define MAILBOX_HSEM_IF_ENABLED
44-
45-
/* Includes ------------------------------------------------------------------*/
46-
/**
47-
* @brief Include Maibox interface header file
48-
*/
49-
50-
#ifdef MAILBOX_IPCC_IF_ENABLED
51-
#include "mbox_ipcc.h"
52-
#endif /* MAILBOX_IPCC_IF_ENABLED */
53-
54-
#ifdef MAILBOX_HSEM_IF_ENABLED
55-
#include "mbox_hsem.h"
56-
#endif /* MAILBOX_HSEM_IF_ENABLED */
57-
58-
/* ########################## Virtual Diver Module Selection ############################## */
59-
/**
60-
* @brief This is the list of modules to be used in the OpenAMP Virtual driver module
61-
* Please note that virtual driver are not supported on all stm32 families
62-
*/
63-
#define VIRTUAL_UART_MODULE_ENABLED
64-
//#define VIRTUAL_I2C_MODULE_ENABLED
65-
66-
67-
/* Includes ------------------------------------------------------------------*/
68-
/**
69-
* @brief Include Virtual Driver module's header file
70-
*/
71-
72-
#ifdef VIRTUAL_UART_MODULE_ENABLED
31+
* Note: Do not remove this. Removing this might not trigger compile error but
32+
* the configuration can be significantly different.
33+
*/
34+
#include "virtio_config.h"
7335
#include "virt_uart.h"
74-
#endif /* VIRTUAL_UART_MODULE_ENABLED */
75-
76-
#ifdef VIRTUAL_I2C_MODULE_ENABLED
77-
#include "virt_i2c.h"
78-
#endif /* VIRTUAL_I2C_MODULE_ENABLED */
7936

8037
/*
8138
* for GCC add the following content to the .ld file:

0 commit comments

Comments
 (0)