<commit_before>#ifndef TIMEDISPLAY_H
#define TIMEDISPLAY_H

#include "TimeDisplay.h"

#include "SecondsRing.h"

#include <graphics.h>
#include <gpio.h>
#include <led-matrix.h>
#include <threaded-canvas-manipulator.h>

#include <ctime>

using namespace rgb_matrix;
using namespace uwhtimer;

TimeDisplay::TimeDisplay(unsigned DisplayNum)
  : DisplayNum(DisplayNum) {}

void TimeDisplay::Render(Canvas *C) {
  Color Yellow(255, 255, 0);
  Color Green(0, 255, 0);
  Color Black(0, 0, 0);

  unsigned Now = time(nullptr);
  unsigned Secs = Now % 60;
  unsigned Tens = Secs / 10;
  unsigned Ones = Secs % 10;

  // Minutes
  BigNumber::RenderHalfSingle(C, DisplayNum, Tens, 1, 2, Green, &Black);
  BigNumber::RenderHalfSingle(C, DisplayNum, Ones, 15, 2, Green, &Black);

  // Seconds
  BigNumber::RenderQuarterSingle(C, DisplayNum, Tens, 8, 20, Green, &Black);
  BigNumber::RenderQuarterSingle(C, DisplayNum, Ones, 15, 20, Green, &Black);<commit_msg>Display time as Mins and Secs<commit_after>#ifndef TIMEDISPLAY_H
#define TIMEDISPLAY_H

#include "TimeDisplay.h"

#include "SecondsRing.h"

#include <graphics.h>
#include <gpio.h>
#include <led-matrix.h>
#include <threaded-canvas-manipulator.h>

#include <ctime>

using namespace rgb_matrix;
using namespace uwhtimer;

TimeDisplay::TimeDisplay(unsigned DisplayNum)
  : DisplayNum(DisplayNum) {}

void TimeDisplay::Render(Canvas *C) {
  Color Yellow(255, 255, 0);
  Color Green(0, 255, 0);
  Color Black(0, 0, 0);

  unsigned Now = time(nullptr);

  // Note that we show 1h30m as 90m here:
  unsigned Mins = (Now / 60) % 100;
  unsigned MTens = Mins / 10;
  unsigned MOnes = Mins % 10;

  // Minutes
  BigNumber::RenderHalfSingle(C, DisplayNum, MTens, 1, 2, Green, &Black);
  BigNumber::RenderHalfSingle(C, DisplayNum, MOnes, 15, 2, Green, &Black);

  unsigned Secs = Now % 60;
  unsigned STens = Secs / 10;
  unsigned SOnes = Secs % 10;

  // Seconds
  BigNumber::RenderQuarterSingle(C, DisplayNum, STens, 8, 20, Green, &Black);
  BigNumber::RenderQuarterSingle(C, DisplayNum, SOnes, 15, 20, Green, &Black);
{'fraction_non_alphanumeric': 0.13596491228070176, 'fraction_numerical': 0.03898635477582846, 'mean_word_length': 4.882521489971347, 'pattern_counts': {'":': 0, '<': 13, '<?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': '5858739', 'n_tokens_mistral': 819, 'n_tokens_neox': 735, 'n_words': 199}