Commit 57b25b5
committed
Add RTC module to ports/analog for MAX32690_apard
I added a port-specific module, RTC to ports/analog. Now the analog port is capable of
handling `rtc.set_time_source()`, `rtc.RTC()` and `r.datetime()`. Note that the RTC
calibration functions are not implemented and is planned for near future.
The implementation in the RTC module also enables two functions in the time module,
which are `time.time()` and `time.localtime()`.
The following example prints the current time every second:
import time
import rtc
r = rtc.RTC)
r.datetime = time.struct_Time((2000, 1, 1, 1, 1, 1, 0, -1, -1))
while(True):
current_time = r.datetime
print(current_time)
time.sleep(1)
Files I modified:
* ports/analog/common-hal/rtc/RTC.c
* ports/analog/common-hal/rtc/RTC.h
* ports/analog/common-hal/rtc/__init__.c
* ports/analog/mpconfigport.mk1 parent 639795c commit 57b25b5
File tree
4 files changed
+60
-1
lines changed- ports/analog
- common-hal/rtc
4 files changed
+60
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
0 commit comments