-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSegment.h
More file actions
31 lines (27 loc) · 725 Bytes
/
Copy pathSegment.h
File metadata and controls
31 lines (27 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#ifndef __SEGMENT__
#define __SEGMENT__
#include "Arduino.h"
typedef uint8_t u2_t;
#define FALSE 0
#define TRUE 1
#define INVALID_SEGMENT ((unsigned char)0b00110110)
struct Segment{
public:
Segment(uint8_t number)
: Segment(number, FALSE) { };
Segment(uint8_t number, u2_t dot)
: Segment(static_cast<char>(number), dot) { };
Segment(char symbol)
: Segment(symbol, FALSE) { };
Segment(char symbol, u2_t dot);
unsigned char getRaw() { return this->raw; }
u2_t isDot () { return this->dot; }
protected:
u2_t findInFonts(char symbol);
unsigned char cast2raw(char symbol);
char toLower_r(char symbol);
unsigned char raw;
u2_t dot;
};
#endif