Skip to content

Commit 64c96fd

Browse files
ChetSimpsonejaquay
authored andcommitted
add member variables to cloud9 rtc
1 parent 104c3cc commit 64c96fd

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

libcommon/include/vcc/devices/rtc/cloud9.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22
#include <vcc/core/detail/exports.h>
3+
#include <Windows.h>
34

45

56
namespace vcc::devices::rtc
@@ -11,7 +12,26 @@ namespace vcc::devices::rtc
1112

1213
void set_read_only(bool value);
1314

14-
unsigned char read_port(unsigned short port_id) const;
15+
unsigned char read_port(unsigned short port_id);
16+
17+
18+
private:
19+
20+
void set_time();
21+
22+
23+
private:
24+
25+
SYSTEMTIME now;
26+
unsigned __int64 InBuffer = 0;
27+
unsigned __int64 OutBuffer = 0;
28+
unsigned char BitCounter = 0;
29+
unsigned char TempHour = 0;
30+
unsigned char AmPmBit = 0;
31+
unsigned __int64 CurrentBit = 0;
32+
unsigned char FormatBit = 0; //1 = 12Hour Mode
33+
unsigned char CookieRecived = 0;
34+
unsigned char WriteEnabled = 0;
1535
};
1636

1737
}

libcommon/src/devices/rtc/cloud9.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,7 @@ along with VCC (Virtual Color Computer). If not, see <http://www.gnu.org/licens
2929
namespace vcc::devices::rtc
3030
{
3131

32-
static SYSTEMTIME now;
33-
static unsigned __int64 InBuffer = 0;
34-
static unsigned __int64 OutBuffer = 0;
35-
static unsigned char BitCounter = 0;
36-
static unsigned char TempHour = 0;
37-
static unsigned char AmPmBit = 0;
38-
static unsigned __int64 CurrentBit = 0;
39-
static unsigned char FormatBit = 0; //1 = 12Hour Mode
40-
static unsigned char CookieRecived = 0;
41-
static unsigned char WriteEnabled = 0;
42-
43-
void SetTime();
44-
45-
unsigned char cloud9::read_port(unsigned short port) const
32+
unsigned char cloud9::read_port(unsigned short port)
4633
{
4734
unsigned char ret_val = 0;
4835

@@ -59,7 +46,7 @@ namespace vcc::devices::rtc
5946
{
6047
if (BitCounter == 0)
6148
{
62-
SetTime();
49+
set_time();
6350
CookieRecived = 0;
6451
}
6552
BitCounter--;
@@ -134,7 +121,7 @@ namespace vcc::devices::rtc
134121
}
135122

136123

137-
void SetTime()
124+
void cloud9::set_time()
138125
{
139126
now.wMilliseconds = (unsigned short)(InBuffer & 15);
140127
InBuffer >>= 4;

0 commit comments

Comments
 (0)