<commit_before>﻿/*
 * debug.c
 *
 * Created: 11/1/2016 3:59:37 PM
 *  Author: patsl736
 */ 

#include "config.h"
#include "debug.h"

#include <avr/io.h>
#include <inttypes.h>
#include <assert.h>
#include <stdbool.h>

#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)

void USARTWriteChar(char data);
int USARTPutChar(char data, FILE *stream);

static FILE uart_stdout = FDEV_SETUP_STREAM(USARTPutChar, NULL, _FDEV_SETUP_WRITE);

bool uart_initialized = false;

void initialize_uart() {
	// Set baud rate
	UBRR0L = BAUD_PRESCALE;
	UBRR0H = (BAUD_PRESCALE>>8);
	
	// Enable RX and TX for USART
	UCSR0B=(1<<RXEN0)|(1<<TXEN0);
	
	// Redirect stdout to UART
	stdout = &uart_stdout;<commit_msg>Testing cyd commits<commit_after>﻿/*
 * debug.c
 *
 * Created: 11/1/2016 3:59:37 PM
 *  Author: patsl736
 */ 

#include "config.h"
#include "debug.h"

#include <avr/io.h>
#include <inttypes.h>
#include <assert.h>
#include <stdbool.h>

#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)

void USARTWriteChar(char data);
int USARTPutChar(char data, FILE *stream);

static FILE uart_stdout = FDEV_SETUP_STREAM(USARTPutChar, NULL, _FDEV_SETUP_WRITE);

bool uart_initialized = false;


void initialize_uart() {
	// Set baud rate
	UBRR0L = BAUD_PRESCALE;
	UBRR0H = (BAUD_PRESCALE>>8);
	
	// Enable RX and TX for USART
	UCSR0B=(1<<RXEN0)|(1<<TXEN0);
	
	// Redirect stdout to UART
	stdout = &uart_stdout;
{'fraction_non_alphanumeric': 0.14599574769666904, 'fraction_numerical': 0.0368532955350815, 'mean_word_length': 4.515625, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, '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': '2817906', 'n_tokens_mistral': 630, 'n_tokens_neox': 594, 'n_words': 131}