/* Function for determining whether the keyboard matrix state has changed compared to the state before.  */
static bool cherry8x16_have_keys_changed(const uint8_t *state_now, uint8_t number_of_now_pressed_keys, const uint8_t *state_before, uint8_t number_of_before_pressed_keys)
/* Function for determining whether the keyboard matrix state has changed compared to the state before.  */
static bool cherry8x16_have_keys_changed(const uint8_t *state_now, uint8_t number_of_now_pressed_keys, const uint8_t *state_before, uint8_t number_of_before_pressed_keys)
{
    if (number_of_now_pressed_keys != number_of_before_pressed_keys)
    {
        return true;
    }
    else
    {
        for (uint_fast8_t i = number_of_now_pressed_keys; i--;)
        {
            if (state_now[i] != state_before[i])
            {
                return true;
            }
        }
    }
    return false;
}