Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: RTC8564.cpp
- Revision:
- 1:d1b58c478a7a
- Parent:
- 0:863510ffa8ff
--- a/RTC8564.cpp Sat Mar 14 05:00:12 2015 +0000 +++ b/RTC8564.cpp Wed Aug 23 09:27:22 2017 +0000 @@ -3,28 +3,24 @@ * Control RTC-8564NB Real Time Clock Module * EPSON TOYOCOM * - * Copyright (c) 2015 Kenji Arai / JH1PJL + * Copyright (c) 2015,'17 Kenji Arai / JH1PJL * http://www.page.sannet.ne.jp/kenjia/index.html * http://mbed.org/users/kenjiArai/ - * Created: Feburary 1st, 2015 - * Revised: March 14th, 2015 - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * Created: Feburary 1st, 2015 + * Revised: August 23rd, 2017 */ #include "mbed.h" #include "RTC8564.h" -RTC8564::RTC8564 (PinName p_sda, PinName p_scl) : _i2c(p_sda, p_scl) +RTC8564::RTC8564 (PinName p_sda, PinName p_scl) + : _i2c_p(new I2C(p_sda, p_scl)), _i2c(*_i2c_p) { RTC8564_addr = RTC8564ADDR; } -RTC8564::RTC8564 (I2C& p_i2c) : _i2c(p_i2c) +RTC8564::RTC8564 (I2C& p_i2c) + : _i2c(p_i2c) { RTC8564_addr = RTC8564ADDR; } @@ -163,3 +159,5 @@ tmp = ((uint8_t)(dt & (uint8_t)0xf0) >> (uint8_t)0x4) * 10; return (tmp + (dt & (uint8_t)0x0f)); } + +