Skip to content

Commit

Permalink
Merge pull request #3 from BluetoothKeyboard/fix-OS-TG
Browse files Browse the repository at this point in the history
Fix to std::copy that didn't copy the OS and TG buffers back into the…
  • Loading branch information
jpconstantineau authored May 23, 2020
2 parents 0d285ab + befd395 commit aee40d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,4 @@ The following tools are used:
- GCC ARM Embedded as the compiler
- Nordic's nrfutil 0.5.2 for flashing the firmware by serial interface
- J-Link for flashing the bootloader by SWD interface

6 changes: 3 additions & 3 deletions firmware/KeyScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ uint8_t layer = getlayer(detectedlayerkeys);
* key has been pressed
*/

std::copy(toggleBuffer.begin(), toggleBuffer.end(), activeKeys.begin());
std::copy(toggleBuffer.begin(), toggleBuffer.end(), back_inserter(activeKeys));
/* for (auto activation : toggleBuffer)
{
activeKeys.push_back(activation);
}*/

if (emptyOneshot)
{
std::copy(oneshotBuffer.begin(), oneshotBuffer.end(), activeKeys.begin());
std::copy(oneshotBuffer.begin(), oneshotBuffer.end(), back_inserter(activeKeys));
/* for (auto activation : oneshotBuffer)
{
activeKeys.push_back(activation);
Expand Down Expand Up @@ -418,4 +418,4 @@ std::vector<uint16_t> KeyScanner::activeKeys {};
std::vector<uint16_t> KeyScanner::macroBuffer {};
std::vector<uint16_t> KeyScanner::toggleBuffer {};
std::vector<uint16_t> KeyScanner::leaderBuffer {};
std::vector<uint16_t> KeyScanner::oneshotBuffer {};
std::vector<uint16_t> KeyScanner::oneshotBuffer {};

0 comments on commit aee40d9

Please sign in to comment.