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.
Revision 1:d1b58c478a7a, committed 2017-08-23
- Comitter:
- kenjiArai
- Date:
- Wed Aug 23 09:27:22 2017 +0000
- Parent:
- 0:863510ffa8ff
- Commit message:
- countermeasure for NonCopyable
Changed in this revision
| RTC8564.cpp | Show annotated file Show diff for this revision Revisions of this file |
| RTC8564.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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));
}
+
+
--- a/RTC8564.h Sat Mar 14 05:00:12 2015 +0000
+++ b/RTC8564.h Wed Aug 23 09:27:22 2017 +0000
@@ -3,17 +3,11 @@
* 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
*/
/*
*---------------- REFERENCE ----------------------------------------------------------------------
@@ -162,7 +156,8 @@
uint8_t bin2bcd(uint8_t);
uint8_t bcd2bin(uint8_t);
- I2C _i2c;
+ I2C *_i2c_p;
+ I2C &_i2c;
private:
uint8_t RTC8564_addr;
@@ -170,3 +165,4 @@
};
#endif // RTC8564_H
+