Add setting date-time example with new rtc lib

This commit is contained in:
BlackMark 2020-05-16 17:26:56 +02:00
parent 4b3dd99ebc
commit 5d77cad8d7
7 changed files with 24 additions and 3 deletions

3
.gitmodules vendored
View File

@ -16,3 +16,6 @@
[submodule "ds3231/i2c"] [submodule "ds3231/i2c"]
path = ds3231/i2c path = ds3231/i2c
url = git@git.blackmark.me:avr/i2c.git url = git@git.blackmark.me:avr/i2c.git
[submodule "ds3231/util"]
path = ds3231/util
url = git@git.blackmark.me:avr/util.git

@ -1 +1 @@
Subproject commit 54b8917705125bdea47f74e4c911650da5bb025f Subproject commit 11211be9b9b823c73c20b5b419e3ff7b82b48e3e

View File

@ -275,12 +275,19 @@
<Compile Include="uart\uart.hpp"> <Compile Include="uart\uart.hpp">
<SubType>compile</SubType> <SubType>compile</SubType>
</Compile> </Compile>
<Compile Include="util\func.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="util\util.hpp">
<SubType>compile</SubType>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="ds3231" /> <Folder Include="ds3231" />
<Folder Include="io" /> <Folder Include="io" />
<Folder Include="flash" /> <Folder Include="flash" />
<Folder Include="i2c" /> <Folder Include="i2c" />
<Folder Include="util" />
<Folder Include="uart" /> <Folder Include="uart" />
<Folder Include="type" /> <Folder Include="type" />
</ItemGroup> </ItemGroup>

@ -1 +1 @@
Subproject commit ff131d92a1b8e92efc2ae24306d7b7cac3cfb28a Subproject commit 8af5afd00d1cba9211e4fe9be1df44a14b7973a1

View File

@ -140,6 +140,16 @@ int main()
cSerial.init(); cSerial.init();
sei(); sei();
rtc::DateTime date;
date.year = 2020;
date.month = 5;
date.day = 16;
date.hour = 17;
date.minute = 24;
date.second = 10;
ds3231.setDateTime(date);
setup(); setup();
while (true) { while (true) {

@ -1 +1 @@
Subproject commit 65d8928ff458aceb74ac44f214427f3ea8eaefc1 Subproject commit 01fad9046ea3125e47ff3ed0e97f098759265f3e

1
ds3231/util Submodule

@ -0,0 +1 @@
Subproject commit d045bbffc3338a747bafc58db444f1aa70efd221