/*

  Misc helper functions used in the main Open Gamma Detector sketch.

  2023, NuclearPhoenix. Open Gamma Project.
  https://github.com/OpenGammaProject/Open-Gamma-Detector

*/

#ifndef HELPER_H
#define HELPER_H

#include <Arduino.h>  // Needed for Serial, String and uint data types

const String RESET_REASON_TEXT[8] = { "unknown", "power-on", "run pin", "software", "watchdog", "debug", "glitch", "brownout" };

void cleanPrintln(const String &text = String(""));
void cleanPrintln(unsigned int number, int base = DEC);
void cleanPrint(const String &text = String(""));
void cleanPrint(unsigned int number, int base = DEC);

void print(String text = "", bool error = false);
void print(unsigned int number, bool error = false);
void println(String text = "", bool error = false);
void println(unsigned int number, bool error = false);

// opengamma_pcb, 32x32 px
const uint8_t opengamma_pcb[] = {
  0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00,
  0x00, 0x01, 0x80, 0x00,
  0x00, 0x01, 0x80, 0x00,
  0x00, 0x03, 0xc0, 0x00,
  0x00, 0x07, 0xe0, 0x00,
  0x00, 0x06, 0x60, 0x00,
  0x00, 0x0c, 0x30, 0x00,
  0x00, 0x0c, 0x30, 0x00,
  0x00, 0x18, 0x18, 0x00,
  0x00, 0x18, 0x18, 0x00,
  0x00, 0x30, 0x0c, 0x00,
  0x00, 0x60, 0x06, 0x00,
  0x00, 0x68, 0x16, 0x00,
  0x00, 0xdc, 0x33, 0x00,
  0x00, 0xd6, 0x33, 0x00,
  0x01, 0x92, 0x31, 0x80,
  0x01, 0x82, 0x21, 0x80,
  0x03, 0x01, 0x60, 0xc0,
  0x06, 0x01, 0x40, 0x60,
  0x06, 0x00, 0x00, 0x60,
  0x0c, 0x00, 0x80, 0x30,
  0x0c, 0x00, 0x80, 0x30,
  0x18, 0x01, 0x80, 0x18,
  0x38, 0x01, 0x80, 0x1c,
  0x30, 0x01, 0x80, 0x0c,
  0x60, 0x01, 0x80, 0x06,
  0x60, 0x01, 0x80, 0x06,
  0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff,
  0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00
};

// play_solid, 6x8 px
const uint8_t play_solid[] = {
  0x00, 0xe0, 0xf0, 0xfc, 0xfc, 0xf0, 0xe0, 0x00
};

#endif  // HELPER_H
