diff --git a/.gitmodules b/.gitmodules index c71a746..a89dd6c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "ds3231/type"] path = ds3231/type url = git@git.blackmark.me:avr/type.git +[submodule "ds3231/i2c"] + path = ds3231/i2c + url = git@git.blackmark.me:avr/i2c.git diff --git a/ds3231/ds3231 b/ds3231/ds3231 index 04af54e..2768009 160000 --- a/ds3231/ds3231 +++ b/ds3231/ds3231 @@ -1 +1 @@ -Subproject commit 04af54e7c8029f05a999f85afa0bcc194f654fed +Subproject commit 27680097203f1482ba61a9cceef689305d7eadc4 diff --git a/ds3231/ds3231.cppproj b/ds3231/ds3231.cppproj index 0b055a6..9715776 100644 --- a/ds3231/ds3231.cppproj +++ b/ds3231/ds3231.cppproj @@ -83,6 +83,17 @@ + + \Debug\ds3231.lss + + + .lss + ^\s*(?<address>[a-f0-9]*):\s*.*$ + true + address + $pc + + @@ -213,21 +224,15 @@ compile - - compile - - - compile - - - compile - - - compile - compile + + compile + + + compile + compile @@ -266,6 +271,7 @@ + diff --git a/ds3231/i2c b/ds3231/i2c new file mode 160000 index 0000000..ff131d9 --- /dev/null +++ b/ds3231/i2c @@ -0,0 +1 @@ +Subproject commit ff131d92a1b8e92efc2ae24306d7b7cac3cfb28a diff --git a/ds3231/main.cpp b/ds3231/main.cpp index b2e7da5..7301d90 100644 --- a/ds3231/main.cpp +++ b/ds3231/main.cpp @@ -1,14 +1,16 @@ #include "clock.hpp" -#include #include #include #include #include -#include "systime.h" +#include + #include "uart/uart.hpp" +#include "systime.h" + using uart_t = uart::Uart0<>; REGISTER_UART0_INT_VECTORS(uart_t); diff --git a/ds3231/systime.cpp b/ds3231/systime.cpp index 315f255..4f79579 100644 --- a/ds3231/systime.cpp +++ b/ds3231/systime.cpp @@ -22,7 +22,6 @@ int SysTime::euDST( const time_t *pTime, int32_t *pZ ) ////////////////////////////////////////////////////////////////////////// bool SysTime::init() { - twi_init_master(); rtc_init(); if( !rtc_is_ds3231() ) @@ -104,4 +103,4 @@ void SysTime::setTime( const tm &sTime ) rtc_set_time( pRtcTime ); syncSysTime(); -} \ No newline at end of file +} diff --git a/ds3231/systime.h b/ds3231/systime.h index af8e0bc..d7c4d7a 100644 --- a/ds3231/systime.h +++ b/ds3231/systime.h @@ -9,7 +9,6 @@ #include -#include "ds3231/twi.h" #include "ds3231/rtc.h" class SysTime