<commit_before>/*
 * @brief A program for the EA NXP LPC4088QSB to flash LED1, LED2, LED3 and LED4.
 *        LEDs are controlled by the joystick. LEFT -> LED1, DOWN -> LED2,
 *        UP -> LED3, RIGHT -> LED4, CENTER -> All LEDs
 *        This program uses a small, simple library of GPIO functions, and the 
 *        TIMER0 timer.
 * @author <NAME>
 * @date August 2015
 */

#include <stdbool.h>
#include "gpioPin.h"
#include "timer.h"


typedef enum {
	LED1, LED2, LED3, LED4,
	JLEFT, JDOWN, JUP, JCENTER, JRIGHT
} deviceNames_t;

bool buttonPressedAndReleased(gpioPin_t *pin);
void delay(uint32_t ms);
void timer0Handler(void);
void timer1Handler(void);

static gpioPin_t pin[9];
static bool flashing[4] = {false, false, false, false};

int main() {
	gpioPinInit(&pin[LED1], 1, 18, OUTPUT_PIN);
	gpioPinInit(&pin[LED2], 0, 13, OUTPUT_PIN);
	gpioPinInit(&pin[LED3], 1, 13, OUTPUT_PIN);
	gpioPinInit(&pin[LED4], 2, 19, OUTPUT_PIN);
	gpioPinInit(&pin[JLEFT],   5, 0, INPUT_PIN);
	gpioPinInit(&pin[JDOWN],   5, 1, INPUT_PIN);
	gpioPinInit(&pin[JUP],     5, 2, INPUT_PIN);
	gpioPinInit(&pin[JCENTER], 5, 3, INPUT_PIN);
	gpioPinInit(&pin[JRIGHT],  5, 4, INPUT_PIN);

	timer0Init(1, timer0Handler);

	while (true) {
		if (buttonPressedAndReleased(&pin[JLEFT])) {
			flashing[LED1] = !flashing[LED1];
		}
		if (buttonPressedAndReleased(&pin[JDOWN])) {
			flashing[LED2] = !flashing[LED2];<commit_msg>Removed unnecessary function prototype: timer1handler()<commit_after>/*
 * @brief A program for the EA NXP LPC4088QSB to flash LED1, LED2, LED3 and LED4.
 *        LEDs are controlled by the joystick. LEFT -> LED1, DOWN -> LED2,
 *        UP -> LED3, RIGHT -> LED4, CENTER -> All LEDs
 *        This program uses a small, simple library of GPIO functions, and the 
 *        TIMER0 timer.
 * @author <NAME>
 * @date August 2015
 */

#include <stdbool.h>
#include "gpioPin.h"
#include "timer.h"


typedef enum {
	LED1, LED2, LED3, LED4,
	JLEFT, JDOWN, JUP, JCENTER, JRIGHT
} deviceNames_t;

bool buttonPressedAndReleased(gpioPin_t *pin);
void delay(uint32_t ms);
void timer0Handler(void);

static gpioPin_t pin[9];
static bool flashing[4] = {false, false, false, false};

int main() {
	gpioPinInit(&pin[LED1], 1, 18, OUTPUT_PIN);
	gpioPinInit(&pin[LED2], 0, 13, OUTPUT_PIN);
	gpioPinInit(&pin[LED3], 1, 13, OUTPUT_PIN);
	gpioPinInit(&pin[LED4], 2, 19, OUTPUT_PIN);
	gpioPinInit(&pin[JLEFT],   5, 0, INPUT_PIN);
	gpioPinInit(&pin[JDOWN],   5, 1, INPUT_PIN);
	gpioPinInit(&pin[JUP],     5, 2, INPUT_PIN);
	gpioPinInit(&pin[JCENTER], 5, 3, INPUT_PIN);
	gpioPinInit(&pin[JRIGHT],  5, 4, INPUT_PIN);

	timer0Init(1, timer0Handler);

	while (true) {
		if (buttonPressedAndReleased(&pin[JLEFT])) {
			flashing[LED1] = !flashing[LED1];
		}
		if (buttonPressedAndReleased(&pin[JDOWN])) {
			flashing[LED2] = !flashing[LED2];
{'fraction_non_alphanumeric': 0.14935988620199148, 'fraction_numerical': 0.04267425320056899, 'mean_word_length': 4.504892367906066, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '1812247', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1083, 'n_words': 281}