<commit_before>/*
 * i2c.c
 *
 *      Author: <NAME>
 */

#include "chip.h"
#include "i2c.h"

/* I2C master handle and memory for ROM API */
static I2C_HANDLE_T *i2cHandleMaster;

/* Use a buffer size larger than the expected return value of
   i2c_get_mem_size() for the static I2C handle type */
static uint32_t i2cMasterHandleMEM[0x20];

static void errorI2C(void) {
  while (1) {}
}

/* Setup I2C handle and parameters */
void setupI2CMaster(void) {
  /* Enable I2C clock and reset I2C peripheral - the boot ROM does not do this */
  Chip_I2C_Init();

  /* Perform a sanity check on the storage allocation */
  if (LPC_I2CD_API->i2c_get_mem_size() > sizeof(i2cMasterHandleMEM)) {
    /* Example only: this should never happen and probably isn't needed for most I2C code. */
    errorI2C();<commit_msg>updated code because LPCOpen 2.15 library changes I2C handling<commit_after>/*
 * i2c.c
 *
 *      Author: <NAME>
 */

#include "chip.h"
#include "i2c.h"

/* I2C master handle and memory for ROM API */
static I2C_HANDLE_T *i2cHandleMaster;

/* Use a buffer size larger than the expected return value of
   i2c_get_mem_size() for the static I2C handle type */
static uint32_t i2cMasterHandleMEM[0x20];

static void errorI2C(void) {
  while (1) {}
}

/* Setup I2C handle and parameters */
void setupI2CMaster(void) {
  /* Enable I2C clock and reset I2C peripheral - the boot ROM does not do this */
  Chip_I2C_Init(LPC_I2C);

  /* Perform a sanity check on the storage allocation */
  if (LPC_I2CD_API->i2c_get_mem_size() > sizeof(i2cMasterHandleMEM)) {
    /* Example only: this should never happen and probably isn't needed for most I2C code. */
    errorI2C();
{'fraction_non_alphanumeric': 0.1014405762304922, 'fraction_numerical': 0.033013205282112844, 'mean_word_length': 3.7357954545454546, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '773134', 'n_tokens_mistral': 606, 'n_tokens_neox': 585, 'n_words': 193}