Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

setExtInt() must be called before begin() — undocumented ordering requirement causes silent CSV misalignment

Đang mở
#6 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

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

Hướng nghiên cứu

Start by reading the implementations of begin(), setExtInt(), and getExtIntCount(), then trace how the SD-card header and data rows are assembled. Done means the ordering requirement is documented and enforced, or the header is rebuilt when needed, with ext-int values and CSV labels remaining aligned.

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

Mô tả

Bug

begin() checks ExtIntPin at call time to decide whether to append ext_int_header_entry to the log file header. If setExtInt() is called after begin() — a natural usage pattern, since setExtInt() is a public function with no documented ordering requirement — the interrupt itself works, but the header written to the SD card lacks the ext-int column label. Data rows will include the count value (appended by the user's Update() function via getExtIntCount()), producing silent CSV column misalignment from the first row onward.

Example

void setup() {
    logger.begin("SensorData,");  // header written: "SensorData,..."
    logger.setExtInt(2);          // too late — ext_int column not in header
}

Every data row will have one extra column with no header, breaking downstream CSV parsing.

Fix

Either: (a) document that setExtInt() must be called before begin() (and enforce with an assert or early return in begin() if called afterward), or (b) separate header initialization from begin() so the header can be rebuilt when setExtInt() is called.

Severity

Medium — silent data integrity issue; no runtime error.

🤖 Generated with Claude Code

Ngôn ngữ chính
C++
Star
1
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NorthernWidget/Okapi_Library

Tất cả issue của NorthernWidget/Okapi_Library

Issue tương tự

Thêm issue về C++

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.