<commit_before>/*
 * ReflexTestData.c
 *
 *  Created on: Jun 3, 2015
 *      Author: travis
 */

#include "ReflexTestData.h"

#include <stdio.h>
#include <stdlib.h>

static uint32_t sequence[REFLEXTESTDATA_SEQUENCE_LENGTH];
static int32_t index = 0;
static int32_t pressedButton = 0;
static double responseTime;
static ReflexTest_st currentState = init_st;
static double min = 5.0;
static double max = 0.0;
static double average = 0.0;

void ReflexTestData_Init() {
  index = 0;
  pressedButton = 0;
  responseTime = 0.0;
  min = 5.0;
  max = 0.0;
  average = 0.0;

  int i;
  for (i = 0; i < REFLEXTESTDATA_SEQUENCE_LENGTH; i++) {
    sequence[i] = 0;
  }
}

bool ReflexTestData_IsSequenceDone() {
  return (index == (REFLEXTESTDATA_SEQUENCE_LENGTH));
}

int32_t ReflexTestData_GetNextLedAndIncrement() {

  if (index < REFLEXTESTDATA_SEQUENCE_LENGTH) {
   return sequence[index];
  }
  else {
    return REFLEXTESTDATA_ERROR;
  }
}

void ReflexTestData_IncrementIndex() {
  if (index < REFLEXTESTDATA_SEQUENCE_LENGTH) {
    index++;
  }
}<commit_msg>Fixed bugs in reflextestdata<commit_after>/*
 * ReflexTestData.c
 *
 *  Created on: Jun 3, 2015
 *      Author: travis
 */

#include "ReflexTestData.h"

#include <stdio.h>
#include <stdlib.h>

static uint32_t sequence[REFLEXTESTDATA_SEQUENCE_LENGTH];
static int32_t index = 0;
static int32_t pressedButton = 0;
static double responseTime;
static ReflexTest_st currentState = init_st;
static double min = 5.0;
static double max = 0.0;
static double average = 0.0;

void ReflexTestData_Init() {
  index = 0;
  pressedButton = 0;
  responseTime = 0.0;
  min = 5.0;
  max = 0.0;
  average = 0.0;
  currentState = init_st;

  int i;
  for (i = 0; i < REFLEXTESTDATA_SEQUENCE_LENGTH; i++) {
    sequence[i] = 0;
  }
}

bool ReflexTestData_IsSequenceDone() {
  return (index == (REFLEXTESTDATA_SEQUENCE_LENGTH));
}

int32_t ReflexTestData_GetNextLedAndIncrement() {

  if (index < REFLEXTESTDATA_SEQUENCE_LENGTH) {
   return sequence[index];
  }
  else {
    return REFLEXTESTDATA_ERROR;
  }
}

void ReflexTestData_IncrementIndex() {
  // -1 so that index stays on the last element
  if (index < REFLEXTESTDATA_SEQUENCE_LENGTH-1) {
    index++;
  }
}
{'fraction_non_alphanumeric': 0.1111617312072893, 'fraction_numerical': 0.030979498861047835, 'mean_word_length': 3.979591836734694, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, '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': '4532076', 'n_tokens_mistral': 884, 'n_tokens_neox': 818, 'n_words': 194}