<commit_before>#include <generated/csr.h>

#include "fx2.h"

#ifdef CSR_FX2_RESET_OUT_ADDR
#include <stdio.h>

#define FX2_HACK_SLAVE_ADDRESS 0x40
#define FX2_HACK_SHIFT_REG_FULL  1
#define FX2_HACK_SHIFT_REG_EMPTY 2
#define FX2_HACK_STATUS_READY 0

#include "fx2_fw_usbjtag.c"
#ifdef ENCODER_BASE
#include "fx2_fw_hdmi2usb.c"
#endif

static void fx2_wait(void) {
	unsigned int i;
	for(i=0;i<1000;i++) __asm__("nop");
}

enum fx2_fw_version fx2_fw_active;


static size_t next_read_addr;
static size_t end_addr;

inline uint8_t fx2_fw_get_value(size_t addr) {
	uint8_t r = 0xff;
	if (addr < end_addr) {
		switch(fx2_fw_active) {
		case FX2FW_USBJTAG:
			r = fx2_mbfw_usbjtag.bytes[addr];
			break;
#ifdef ENCODER_BASE
		case FX2FW_HDMI2USB:
			r = fx2_mbfw_hdmi2usb.bytes[addr];
			break;

#endif
		}
	} else {
		printf("fx2: Read from invalid address for USB-JTAG firmware %02X\n", addr);
	}<commit_msg>Fixing a string and off by 1 error.<commit_after>#include "fx2.h"

#ifdef CSR_FX2_RESET_OUT_ADDR
#include <stdio.h>

#define FX2_HACK_SLAVE_ADDRESS 0x40
#define FX2_HACK_SHIFT_REG_FULL  1
#define FX2_HACK_SHIFT_REG_EMPTY 2
#define FX2_HACK_STATUS_READY 0

#include "fx2_fw_usbjtag.c"
#ifdef ENCODER_BASE
#include "fx2_fw_hdmi2usb.c"
#endif

static void fx2_wait(void) {
	unsigned int i;
	for(i=0;i<1000;i++) __asm__("nop");
}

enum fx2_fw_version fx2_fw_active;


static size_t next_read_addr;
static size_t end_addr;

inline uint8_t fx2_fw_get_value(size_t addr) {
	uint8_t r = 0xff;
	if (addr <= end_addr) {
		switch(fx2_fw_active) {
		case FX2FW_USBJTAG:
			r = fx2_mbfw_usbjtag.bytes[addr];
			break;
#ifdef ENCODER_BASE
		case FX2FW_HDMI2USB:
			r = fx2_mbfw_hdmi2usb.bytes[addr];
			break;
#endif
		}
	} else {
		printf("fx2: Read from invalid address %02X (end: %02X)\n", addr, end_addr);
	}
{'fraction_non_alphanumeric': 0.1048834628190899, 'fraction_numerical': 0.04273029966703663, 'mean_word_length': 5.3936170212765955, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 6, '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': '1026625', 'n_tokens_mistral': 889, 'n_tokens_neox': 828, 'n_words': 163}