<commit_before>#include <pic16f1825.h>

#define NUM_AVERAGES 2

unsigned char data;
struct {
    unsigned locked : 1;
    unsigned dataChanged : 1;
} flags;

static unsigned char wait;
static unsigned int avg[NUM_AVERAGES];

extern unsigned char tx_value;
extern unsigned int tx_uint;
extern void UART_send(void);
extern void UART_send_uchar(void);


/*****************************************************************************
 Init_input()

 Called once during start-up of the firmware. 
 ****************************************************************************/
void Init_input(void) {
    TMR1H = 0;
    TMR1L = 0;
    
    // Set Timer1 to 1us resolution    
    T1GCON = 0b11010000;   // Single shot gate mode
    T1CON = 0b00100001;    // Timer1 runs on Fosc/4; 1:4 pre-scaler; Timer enabled

    flags.locked = 0;
    flags.dataChanged = 0;<commit_msg>Increase averages to 4 so that glitches don't have a big impact<commit_after>#include <pic16f1825.h>

#define NUM_AVERAGES 4

unsigned char data;
struct {
    unsigned locked : 1;
    unsigned dataChanged : 1;
} flags;

static unsigned char wait;
static unsigned int avg[NUM_AVERAGES];

extern unsigned char tx_value;
extern unsigned int tx_uint;
extern void UART_send(void);
extern void UART_send_uchar(void);


/*****************************************************************************
 Init_input()

 Called once during start-up of the firmware. 
 ****************************************************************************/
void Init_input(void) {
    TMR1H = 0;
    TMR1L = 0;
    
    // Set Timer1 to 1us resolution    
    T1GCON = 0b11010000;   // Single shot gate mode
    T1CON = 0b00100001;    // Timer1 runs on Fosc/4; 1:4 pre-scaler; Timer enabled

    flags.locked = 0;
    flags.dataChanged = 0;
{'fraction_non_alphanumeric': 0.24186307519640854, 'fraction_numerical': 0.04657687991021325, 'mean_word_length': 4.094285714285714, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4726442', 'n_tokens_mistral': 615, 'n_tokens_neox': 509, 'n_words': 164}