<commit_before>// ***** 0. Documentation Section *****
// SwitchLEDInterface.c for Lab 8
// Runs on LM4F120/TM4C123
// Use simple programming structures in C to toggle an LED
// while a button is pressed and turn the LED on when the
// button is released.  This lab requires external hardware
// to be wired to the LaunchPad using the prototyping board.
// December 28, 2014
//      <NAME> and <NAME>

// ***** 1. Pre-processor Directives Section *****
#include "TExaS.h"
#include "tm4c123gh6pm.h"

// ***** 2. Global Declarations Section *****
unsigned long in; //eja

// My Functions:

// Function 1:
void delay100ms(unsigned long time) { //eja
	unsigned long i; //eja
	while (time > 0) { //eja
		i = 1333333; //eja
		while (i > 0) { //eja
			i = i - 1; //eja
		} //eja
		time = time - 1; //eja
	} //eja
} //eja


// FUNCTION PROTOTYPES: Each subroutine defined
void DisableInterrupts(void); // Disable interrupts
void EnableInterrupts(void); // Enable interrupts

// ***** 3. Subroutines Section *****

// PE0, PB0, or PA2 connected to positive logic momentary switch using 10k ohm pull down resistor
// PE1, PB1, or PA3 connected to positive logic LED through 470 ohm current limiting resistor
// To avoid damaging your hardware, ensure that your circuits match the schematic
// shown in Lab8_artist.sch (PCB Artist schematic file) or 
// Lab8_artist.pdf (compatible with many various readers like Adobe Acrobat).


int main(void) {
	unsigned long volatile delay; //eja
//**********************************************************************
// The following version tests input on PE0 and output on PE1
//**********************************************************************
  TExaS_Init(SW_PIN_PE0, LED_PIN_PE1);  // activate grader and set system clock to 80 MHz
	
	SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOE; //eja
	delay = SYSCTL_RCGC2_R; //eja
	GPIO_PORTE_AMSEL_R = GPIO_PORTE_AMSEL_R & ~0x03; //eja
	GPIO_PORTE_PCTL_R = GPIO_PORTE_PCTL_R & ~0x000000FF; //eja
	GPIO_PORTE_DIR_R = GPIO_PORTE_DIR_R | 0x02; //eja
	GPIO_PORTE_DIR_R = GPIO_PORTE_DIR_R & ~0x01; //eja
	
	// After this point is not copied from my professors:
	
	GPIO_PORTE_DEN_R = GPIO_PORTE_DEN_R | 0x0008; //eja
	GPIO_PORTE_DEN_R = GPIO_PORTE_DEN_R | 0x0004; //eja
	
	GPIO_PORTE_DATA_R = GPIO_PORTE_DATA_R | 0x0008; //eja
  EnableInterrupts();           // enable interrupts for the grader
  while(1){
		delay100ms(1); //eja
		in = GPIO_PORTE_DATA_R&0x0004; //eja
		
		if (in == 1) { //eja
			GPIO_PORTE_DATA_R = GPIO_PORTE_DATA_R ^ 0x0008; //eja
		} //eja
		else { //eja
			GPIO_PORTE_DATA_R = GPIO_PORTE_DATA_R | 0x0008; //eja
		} //eja
  }
}


<commit_msg>Restart and buzzy again. :<<commit_after>// ***** 0. Documentation Section *****
// SwitchLEDInterface.c for Lab 8
// Runs on LM4F120/TM4C123
// Use simple programming structures in C to toggle an LED
// while a button is pressed and turn the LED on when the
// button is released.  This lab requires external hardware
// to be wired to the LaunchPad using the prototyping board.
// December 28, 2014
//      <NAME> and <NAME>

// ***** 1. Pre-processor Directives Section *****
#include "TExaS.h"
#include "tm4c123gh6pm.h"

// ***** 2. Global Declarations Section *****
unsigned long in; //eja

// FUNCTION PROTOTYPES: Each subroutine defined
void DisableInterrupts(void); // Disable interrupts
void EnableInterrupts(void);  // Enable interrupts

// ***** 3. Subroutines Section *****

// PE0, PB0, or PA2 connected to positive logic momentary switch using 10k ohm pull down resistor
// PE1, PB1, or PA3 connected to positive logic LED through 470 ohm current limiting resistor
// To avoid damaging your hardware, ensure that your circuits match the schematic
// shown in Lab8_artist.sch (PCB Artist schematic file) or 
// Lab8_artist.pdf (compatible with many various readers like Adobe Acrobat).

void delay100ms(unsigned long t) { //eja
	unsigned long i; //eja
	while (t > 0) { //eja
		i = 1333333; //eja
		while (i > 0) { //eja
			i = i - 1; //eja
		} //eja
		t = t - 1; //eja
	} //eja
} //eja

int main(void){
	
	unsigned long volatile delay; //eja
	
//**********************************************************************
// The following version tests input on PE0 and output on PE1
//**********************************************************************
  TExaS_Init(SW_PIN_PE0, LED_PIN_PE1);  // activate grader and set system clock to 80 MHz
  SYSCTL_RCGC2_R = SYSCTL_RCGC2_R | SYSCTL_RCGC2_GPIOE; //eja
	delay = SYSCTL_RCGC2_R; //eja
	GPIO_PORTE_AMSEL_R = GPIO_PORTE_AMSEL_R & ~0x03; //eja
	GPIO_PORTE_PCTL_R = GPIO_PORTE_PCTL_R & ~0x000000FF; //eja
	GPIO_PORTE_DIR_R = GPIO_PORTE_DIR_R | 0x02; //eja
	GPIO_PORTE_DIR_R = GPIO_PORTE_DIR_R & ~0x01; //eja
	
	
  EnableInterrupts();           // enable interrupts for the grader
  while(1){
    
  }
	
}
{'fraction_non_alphanumeric': 0.1674321503131524, 'fraction_numerical': 0.03987473903966597, 'mean_word_length': 3.5283553875236295, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 11, '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': '5354258', 'n_tokens_mistral': 1862, 'n_tokens_neox': 1634, 'n_words': 527}