Skip to content

Commit b0190cd

Browse files
committed
Remove & improve some comments
1 parent bca7b29 commit b0190cd

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

cores/arduino/VirtIOSerial.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ void VirtIOSerial::rxGenericCallback(VIRT_UART_HandleTypeDef *huart)
188188

189189
void VirtIOSerial::rxCallback(VIRT_UART_HandleTypeDef *huart)
190190
{
191-
192191
// Linux host must send a dummy data first to finish initialization of rpmsg
193192
// on the coprocessor side. This message should be discarded.
194193
// run_arduino_gen.sh script will send dummy data: "DUMMY".
@@ -199,7 +198,6 @@ void VirtIOSerial::rxCallback(VIRT_UART_HandleTypeDef *huart)
199198
_VirtIOSerialObj.first_message_discarded = true;
200199
}
201200

202-
/* copy received msg in a variable to sent it back to master processor in main infinite loop*/
203201
size_t size = min(huart->RxXferSize, virtio_buffer_write_available(&_VirtIOSerialObj.ring));
204202
while (size > 0) {
205203
size -= virtio_buffer_write(&_VirtIOSerialObj.ring, huart->pRxBuffPtr, size);

cores/arduino/VirtIOSerial.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
// Serial over OpenAmp
3535

3636
// This structure is used to be able to get VirtIOSerial instance (C++ class)
37-
// from handler (C structure) specially for interrupt management
37+
// from handler (C structure) specially for rpmsg message management
3838
typedef struct {
3939
// Those 2 first fields must remain in this order at the beginning of the structure
4040
void *__this;

cores/arduino/stm32/OpenAMP/mbox_ipcc.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121

2222
/*
2323
* Channel direction and usage:
24-
* virtio_rpmsg_bus.c rpmsg_virtio.c
25-
* ======== <-- new msg ---=============--------<------ =======
26-
* || || rvq (rx) || CHANNEL 1 || svq (tx_vq) || ||
27-
* || A7 || ------->-------=============--- buf free--> || M4 ||
28-
* || || || ||
29-
* ||master|| <-- buf free---=============--------<------ ||slave||
30-
* || || svq (tx) || CHANNEL 2 || rvq (rx_vq) || ||
31-
* ======== ------->-------=============----new msg --> =======
24+
virtio_rpmsg_bus.c virtqueue vring rpmsg_virtio.c
25+
======== <-- new msg ---=============--------<------ ==========
26+
|| || rvq (rx) || IPCC CHANNEL 1 || svq (tx_vq) -> vring0 || ||
27+
|| A7 || ------->-------=============--- buf free--> || M4 ||
28+
|| || || ||
29+
||master|| <-- buf free---=============--------<------ || slave ||
30+
|| || svq (tx) || IPCC CHANNEL 2 || rvq (rx_vq) -> vring1 ||(remote)||
31+
======== ------->-------=============----new msg --> ==========
3232
*/
3333

3434
/* Includes ------------------------------------------------------------------*/
@@ -158,12 +158,12 @@ int MAILBOX_Notify(void *priv, uint32_t vring_id)
158158

159159
/* Check that the channel is free (otherwise wait until it is) */
160160
if (HAL_IPCC_GetChannelStatus(&hipcc, channel, IPCC_CHANNEL_DIR_TX) == IPCC_CHANNEL_STATUS_OCCUPIED) {
161-
// Wait for channel to be freed
161+
/* Wait for channel to be freed */
162162
while (HAL_IPCC_GetChannelStatus(&hipcc, channel, IPCC_CHANNEL_DIR_TX) == IPCC_CHANNEL_STATUS_OCCUPIED)
163163
;
164164
}
165165

166-
/* Inform A7 (either new message, or buf free) */
166+
/* Inform the host processor (either new message, or buf free) */
167167
HAL_IPCC_NotifyCPU(&hipcc, channel, IPCC_CHANNEL_DIR_TX);
168168
return 0;
169169
}
@@ -176,7 +176,7 @@ void IPCC_channel1_callback(IPCC_HandleTypeDef *hipcc,
176176
(void) ChannelDir;
177177
msg_received_ch1 = RX_BUF_FREE;
178178

179-
/* Inform A7 that we have received the 'buff free' msg */
179+
/* Inform the host processor that we have received the 'buff free' msg */
180180
HAL_IPCC_NotifyCPU(hipcc, ChannelIndex, IPCC_CHANNEL_DIR_RX);
181181
}
182182

@@ -187,7 +187,7 @@ void IPCC_channel2_callback(IPCC_HandleTypeDef *hipcc,
187187
(void) ChannelDir;
188188
msg_received_ch2 = RX_NEW_MSG;
189189

190-
/* Don't inform A7 here */
190+
/* Inform the host processor that we have received the msg */
191191
HAL_IPCC_NotifyCPU(hipcc, ChannelIndex, IPCC_CHANNEL_DIR_RX);
192192
}
193193

0 commit comments

Comments
 (0)