<commit_before>/*

OpenDECK library v1.3
File: Buttons.cpp
Last revision date: 2014-12-25
Author: <NAME>

*/

#include "OpenDeck.h"

const uint8_t buttonDebounceCompare = 0b11111000;

void OpenDeck::setButtonPressed(uint8_t buttonNumber, bool state)   {

    uint8_t arrayIndex = buttonNumber/8;
    uint8_t buttonIndex = buttonNumber - 8*arrayIndex;

    bitWrite(buttonPressed[arrayIndex], buttonIndex, state);

}

buttonType OpenDeck::getButtonType(uint8_t buttonNumber)  {

    uint8_t arrayIndex = buttonNumber/8;
    uint8_t buttonIndex = buttonNumber - 8*arrayIndex;

    if (bitRead(_buttonType[arrayIndex], buttonIndex))
        return buttonLatching;

    return buttonMomentary;

}

bool OpenDeck::getButtonPCenabled(uint8_t buttonNumber)   {

    uint8_t arrayIndex = buttonNumber/8;
    uint8_t buttonIndex = buttonNumber - 8*arrayIndex;

    return bitRead(buttonPCenabled[arrayIndex], buttonIndex);

}
<commit_msg>reduce button debounce time<commit_after>/*

OpenDECK library v1.3
File: Buttons.cpp
Last revision date: 2014-12-25
Author: <NAME>

*/

#include "OpenDeck.h"

const uint8_t buttonDebounceCompare = 0b11111100;

void OpenDeck::setButtonPressed(uint8_t buttonNumber, bool state)   {

    uint8_t arrayIndex = buttonNumber/8;
    uint8_t buttonIndex = buttonNumber - 8*arrayIndex;

    bitWrite(buttonPressed[arrayIndex], buttonIndex, state);

}

buttonType OpenDeck::getButtonType(uint8_t buttonNumber)  {

    uint8_t arrayIndex = buttonNumber/8;
    uint8_t buttonIndex = buttonNumber - 8*arrayIndex;

    if (bitRead(_buttonType[arrayIndex], buttonIndex))
        return buttonLatching;

    return buttonMomentary;

}

bool OpenDeck::getButtonPCenabled(uint8_t buttonNumber)   {

    uint8_t arrayIndex = buttonNumber/8;
    uint8_t buttonIndex = buttonNumber - 8*arrayIndex;

    return bitRead(buttonPCenabled[arrayIndex], buttonIndex);

}

{'fraction_non_alphanumeric': 0.08974358974358974, 'fraction_numerical': 0.03739316239316239, 'mean_word_length': 4.675757575757576, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5770580', 'n_tokens_mistral': 667, 'n_tokens_neox': 614, 'n_words': 129}