This commit is contained in:
Man, Jianting (Meco) 2022-03-23 02:28:24 -04:00 committed by GitHub
parent 96b4974ea2
commit 2a1272ecfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -231,12 +231,14 @@ RTM_EXPORT(rt_ringbuffer_get);
*/
rt_size_t rt_ringbuffer_peak(struct rt_ringbuffer *rb, rt_uint8_t **ptr)
{
rt_size_t size;
RT_ASSERT(rb != RT_NULL);
*ptr = RT_NULL;
/* whether has enough data */
rt_size_t size = rt_ringbuffer_data_len(rb);
size = rt_ringbuffer_data_len(rb);
/* no data */
if (size == 0)