feat: 🐛 修正读计数可能跳越界的情况。
This commit is contained in:
parent
2ce255d148
commit
64c7f3f16f
@ -66,7 +66,7 @@ ssize_t send_len;
|
|||||||
// void *map_base_tx_case52; // TX映射地址 20块
|
// void *map_base_tx_case52; // TX映射地址 20块
|
||||||
void *map_base_rx_case52; // RX映射地址 8块
|
void *map_base_rx_case52; // RX映射地址 8块
|
||||||
void *map_base_rxf_case52; // wr 计数映射地址
|
void *map_base_rxf_case52; // wr 计数映射地址
|
||||||
uint8_t w_idx, r_idx; // RX 信号
|
uint8_t w_idx, r_idx; // RX 信号
|
||||||
uint16_t udp_data_buffer[8008];
|
uint16_t udp_data_buffer[8008];
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
|
||||||
@ -275,9 +275,8 @@ void *handleUdpTransmission(void *arg)
|
|||||||
perror("sendto error");
|
perror("sendto error");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
r_idx ++ ;
|
|
||||||
}
|
}
|
||||||
r_idx = r_idx % 8;
|
r_idx = 0;
|
||||||
// 取从头开始
|
// 取从头开始
|
||||||
for (cut_i = 0; cut_i < w_idx; cut_i++)
|
for (cut_i = 0; cut_i < w_idx; cut_i++)
|
||||||
{
|
{
|
||||||
@ -299,6 +298,7 @@ void *handleUdpTransmission(void *arg)
|
|||||||
}
|
}
|
||||||
r_idx ++;
|
r_idx ++;
|
||||||
}
|
}
|
||||||
|
r_idx = r_idx % 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user