greenhouse
Functions | Variables
ui.cpp File Reference
#include "ui/ui.h"
#include "Queue.h"
#include "mbed.h"
#include "stm32746g_discovery_lcd.h"
#include "stm32f7xx_hal.h"
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <queue>
#include <string>
#include <vector>
Include dependency graph for ui.cpp:

Go to the source code of this file.

Functions

void set_default_font ()
 
string microsecond_to_sec_str (uint64_t us)
 
string make_stat_str (string label, string suffix, uint64_t us)
 

Variables

static const int MAX_LOG_LINES = 6
 
static const int LOG_Y_POS = 13
 
int log_idx = 0
 
uint64_t prev_idle_time = 0
 

Function Documentation

◆ make_stat_str()

string make_stat_str ( string  label,
string  suffix,
uint64_t  us 
)

Definition at line 80 of file ui.cpp.

80  {
81  string stat = string(label);
82  stat.append(microsecond_to_sec_str(us));
83  stat.append(suffix);
84 
85  return stat;
86 }
string microsecond_to_sec_str(uint64_t us)
Definition: ui.cpp:68

References microsecond_to_sec_str().

Referenced by UI::Display::update_stats().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ microsecond_to_sec_str()

string microsecond_to_sec_str ( uint64_t  us)

Definition at line 68 of file ui.cpp.

68  {
69  uint64_t converted;
70 
71  if (us > 1) {
72  converted = us / 1000 / 1000;
73  } else {
74  converted = 0;
75  }
76 
77  return std::to_string(converted);
78 }

Referenced by make_stat_str().

Here is the caller graph for this function:

◆ set_default_font()

void set_default_font ( )

Definition at line 20 of file ui.cpp.

20  {
21  BSP_LCD_SetFont(&Font12);
22 }

Referenced by UI::Display::init().

Here is the caller graph for this function:

Variable Documentation

◆ log_idx

int log_idx = 0

Definition at line 17 of file ui.cpp.

Referenced by UI::Display::log().

◆ LOG_Y_POS

const int LOG_Y_POS = 13
static

Definition at line 16 of file ui.cpp.

Referenced by UI::Display::init(), and UI::Display::log().

◆ MAX_LOG_LINES

const int MAX_LOG_LINES = 6
static

Definition at line 15 of file ui.cpp.

Referenced by UI::Display::log().

◆ prev_idle_time

uint64_t prev_idle_time = 0

Definition at line 18 of file ui.cpp.

Referenced by UI::Display::update_stats().