<commit_before>


#include <avr/eeprom.h>

struct pid {
  byte busId;
  byte settings; // unused, unused, unused, unused, unused, unused, unused, add decimal flag
  unsigned int value;
  byte txd[8];
  byte rxf[6];
  byte rxd[2];
  byte mth[6];
  char name[8];
};

struct busConfig {
  int baud;
};

struct cbt_settings {
  byte displayEnabled;
  byte firstboot;
  byte displayIndex;
  struct busConfig busCfg[3];
  byte placeholder4;
  byte hwselftest;
  byte placeholder5;
  byte placeholder6;
  byte placeholder7;
  struct pid pids[8];
  byte padding[32];
} cbt_settings;


class Settings
{
  public:
   static void init();
   static void save( struct cbt_settings *settings );
   static void clear();
   static void firstbootSetup();
   const static int pidLength = 8;
   static void setBaudRate(byte busId, int rate);
   static int getBaudRate(byte busId);
};


void Settings::init()
{
  memset(&cbt_settings, 0, sizeof(cbt_settings));
  eeprom_read_block((void*)&cbt_settings, (void*)0, sizeof(cbt_settings));
  if( cbt_settings.firstboot == 0 || cbt_settings.firstboot == 0xFF )
    Settings::firstbootSetup();
}
<commit_msg>Reordered placeholder 4 in settings (see comment on line 97)<commit_after>


#include <avr/eeprom.h>

struct pid {
  byte busId;
  byte settings; // unused, unused, unused, unused, unused, unused, unused, add decimal flag
  unsigned int value;
  byte txd[8];
  byte rxf[6];
  byte rxd[2];
  byte mth[6];
  char name[8];
};

struct busConfig {
  int baud;
};

struct cbt_settings {
  byte displayEnabled;
  byte firstboot;
  byte displayIndex;
  struct busConfig busCfg[3];
  byte hwselftest;
  byte placeholder4;
  byte placeholder5;
  byte placeholder6;
  byte placeholder7;
  struct pid pids[8];
  byte padding[32];
} cbt_settings;


class Settings
{
  public:
   static void init();
   static void save( struct cbt_settings *settings );
   static void clear();
   static void firstbootSetup();
   const static int pidLength = 8;
   static void setBaudRate(byte busId, int rate);
   static int getBaudRate(byte busId);
};


void Settings::init()
{
  memset(&cbt_settings, 0, sizeof(cbt_settings));
  eeprom_read_block((void*)&cbt_settings, (void*)0, sizeof(cbt_settings));
  if( cbt_settings.firstboot == 0 || cbt_settings.firstboot == 0xFF )
    Settings::firstbootSetup();
}

{'fraction_non_alphanumeric': 0.11423626135871917, 'fraction_numerical': 0.016875811337083515, 'mean_word_length': 4.254545454545455, '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': '2215244', 'n_tokens_mistral': 804, 'n_tokens_neox': 785, 'n_words': 229}