arduino / arduino/ArduinoCore-API

Trouble with static buffer sizes within the RingBuffer libray

Đang mở
#78 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
306
Fork
150
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

(Arduino 1.6.18.1)

- Serial communication:

If serial data are read and the attached device does not support any flow control (like most devices that you can buy) the CPU must be in receive mode all over the time. The data received are buffered in a static preallocated 128 byte buffer SAM) within the Arduino library.

The user application must periodical check if there are data and read them and must do it fast enough, before buffer overflow.

If you do for example SD-card-i/o, the SD-card may awake from sleep mode and that cost a few 100ms, you can quickly get an overflow of the serial buffer.

The only chance to overcome this situation is to align the serial buffer size to your application. If there is no flow control on receive, one cannot use a fixed size for all projects.

Please implement a simple method, that the user can set the size of the buffer from within the project (AVR, SAM, and SAMD(?)).

Currently one must modify (SAM): "Ringbuffer.h" => "#define SERIAL_BUFFER_SIZE xxxxx".

(This topic is currently in discussion within the Arduino group.)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với Ringbuffer.h và định nghĩa SERIAL_BUFFER_SIZE được đề cập trong issue, sau đó so sánh cách thư viện Arduino xử lý buffer cho AVR, SAM và SAMD. Xác định cách một dự án nên thiết lập kích thước mà không chỉnh sửa thư viện, và xác minh rằng kích thước đã chọn được áp dụng trên các nền tảng bị ảnh hưởng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
arduino, cpp
Lĩnh vực
embedded-iot
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.