<commit_before>// This is a watchdog program to be run on an Adafruit Trinket

#define watchDogPin 13
#define resetPin 2

unsigned long watchDogInterval = 30000; // Needs to see a pulse at lease every 30 seconds
unsigned long resetDuration = 5000;
unsigned long fumeHoodMonitorBootTime = 15000;
unsigned long watchDogTimer;

bool watchDogIsBeingPet = false;
bool watchDogHasBeenPet = false;

void setup() {
  Serial.begin(9600);
  pinMode(watchDogPin, INPUT);
  pinMode(resetPin, OUTPUT);
  digitalWrite(resetPin, HIGH);
  delay(fumeHoodMonitorBootTime);
  watchDogTimer = millis();
}

void loop(){
  watchDogIsBeingPet = digitalRead(watchDogPin) == 1;
  if (watchDogIsBeingPet) {
    watchDogHasBeenPet = true;
  } else if (!watchDogIsBeingPet && watchDogHasBeenPet) {
    watchDogTimer = millis();
    watchDogHasBeenPet = false;
  } 
  unsigned long now = millis();
  Serial.println(now - watchDogTimer);
  if(now - watchDogTimer >= watchDogInterval){
    digitalWrite(resetPin, LOW);
    delay(resetDuration);
    digitalWrite(resetPin, HIGH);
    delay(fumeHoodMonitorBootTime);
    watchDogTimer = millis();
  }
}
<commit_msg>Removed Serial lines added for testing on an Arduino Mega<commit_after>// This is a watchdog program to be run on an Adafruit Trinket

#define watchDogPin 1
#define resetPin 2

unsigned long watchDogInterval = 30000; // Needs to see a pulse at lease every 30 seconds
unsigned long resetDuration = 5000;
unsigned long fumeHoodMonitorBootTime = 15000;
unsigned long watchDogTimer;

bool watchDogIsBeingPet = false;
bool watchDogHasBeenPet = false;

void setup() {
  pinMode(watchDogPin, INPUT);
  pinMode(resetPin, OUTPUT);
  digitalWrite(resetPin, HIGH);
  delay(fumeHoodMonitorBootTime);
  watchDogTimer = millis();
}

void loop(){
  watchDogIsBeingPet = digitalRead(watchDogPin) == 1;
  if (watchDogIsBeingPet) {
    watchDogHasBeenPet = true;
  } else if (!watchDogIsBeingPet && watchDogHasBeenPet) {
    watchDogTimer = millis();
    watchDogHasBeenPet = false;
  } 
  unsigned long now = millis();
  if(now - watchDogTimer >= watchDogInterval){
    digitalWrite(resetPin, LOW);
    delay(resetDuration);
    digitalWrite(resetPin, HIGH);
    delay(fumeHoodMonitorBootTime);
    watchDogTimer = millis();
  }
}

{'fraction_non_alphanumeric': 0.09394479073909172, 'fraction_numerical': 0.01914514692787177, 'mean_word_length': 4.746803069053708, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4609581', 'n_tokens_mistral': 801, 'n_tokens_neox': 710, 'n_words': 198}