Repository navigation
Fix ADC sign conversion, upsampling, BLE buffer bounds, and memory le… - #878
Merged
Andrey1994 merged 1 commit intoNov 9, 2026
Conversation
…aks in board drivers
Contributor
Author
|
Hello BrainFlow I've submitted PR #878 addressing ADC sign conversion, upsampling, BLE buffer bounds, memory handling, and unit tests. Thank you for maintaining this excellent open-source project. I'm looking forward to contributing more to BrainFlow! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes several signal-integrity, buffer-safety, and memory-management bugs across board drivers and adds unit test coverage for
custom_cast.h:src/board_controller/pieeg/pieeg_board.cpp):cast_24bit_to_int32(buf + offset)instead ofuint32_t voltage = 16777214 - voltage;, which inverted negative 24-bit ADS1299 samples into positive values and underflowed unsigneduint32_twhenvoltage == 0xFFFFFF.eeg_scale,data_test, anddata_checkvariables.src/board_controller/emotibit/emotibit.cpp):anc_packages[i + 1][channel_index] = anc_packages[i][channel_index]toanc_packages[i * 2 + 1][channel_index] = valso samples are properly duplicated into[2 * i, 2 * i + 1]without overwriting prior entries.MAGNETOMETER_Z,PPG_GREEN, andEDApackage loops tomax_datapoints_in_package.src/board_controller/brainalive/brainalive.cpp):byte_array.size()instead ofsizeof(byte_array)(sizeof(std::vector<uint8_t>)) tosimpleble_peripheral_write_command.packageinBrainAlive::read_data.cast_24bit_to_int32/cast_16bit_to_int32instead of- 65535.knight.cpp,knight_imu.cpp,explore.cpp):if (res > 0)when reading serial payload bytes inKnight::read_thread(matchingKnightIMU::read_thread).safe_loggercalls inknight.cpp,knight_imu.cpp, andexplore.cpp.src/tests/utils/custom_cast_unittest.cpp):custom_cast.h.