<commit_before>#include <rtdevice.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define NAND_SIM  "nand.bin"
#if 1
#define OOB_SIZE        64
#define PAGE_DATA_SIZE  2048
#define PAGE_SIZE       (2048 + 64)
#define PAGE_PER_BLOCK  64
#define BLOCK_SIZE      (PAGE_SIZE * PAGE_PER_BLOCK)
#define BLOCK_NUM       512
// #define BLOCK_NUM        2048
#else
#define OOB_SIZE        16
#define PAGE_SIZE       (512 + OOB_SIZE)
#define PAGE_PER_BLOCK  32
#define BLOCK_SIZE      (PAGE_SIZE * PAGE_PER_BLOCK)
#define BLOCK_NUM       512
#endif

#define ECC_SIZE       ((PAGE_DATA_SIZE) * 3 / 256)

static unsigned char block_data[BLOCK_SIZE];
static struct rt_mtd_nand_device _nanddrv_file_device;
static FILE *file = NULL;

static rt_uint8_t CountBitsInByte(rt_uint8_t byte)
{
    rt_uint8_t count = 0;

    while (byte > 0)
    {<commit_msg>simulator: fix compile errors in nand driver(512+16)<commit_after>#include <rtdevice.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define NAND_SIM  "nand.bin"

#if 1
#define OOB_SIZE        64
#define PAGE_DATA_SIZE  2048
#define PAGE_PER_BLOCK  64
#define ECC_SIZE       ((PAGE_DATA_SIZE) * 3 / 256)
#define BLOCK_NUM       512
#else
#define OOB_SIZE        16
#define PAGE_DATA_SIZE  512
#define PAGE_PER_BLOCK  32
#define ECC_SIZE       ((PAGE_DATA_SIZE) * 3 / 256)
#define BLOCK_NUM       512
#endif

#define BLOCK_SIZE      (PAGE_SIZE * PAGE_PER_BLOCK)
#define PAGE_SIZE       (PAGE_DATA_SIZE + OOB_SIZE)

static unsigned char block_data[BLOCK_SIZE];
static struct rt_mtd_nand_device _nanddrv_file_device;
static FILE *file = NULL;

static rt_uint8_t CountBitsInByte(rt_uint8_t byte)
{
    rt_uint8_t count = 0;

    while (byte > 0)
    {
{'fraction_non_alphanumeric': 0.0880466472303207, 'fraction_numerical': 0.04723032069970846, 'mean_word_length': 3.793296089385475, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '3612254', 'n_tokens_mistral': 704, 'n_tokens_neox': 635, 'n_words': 167}