Skip to content

Commit ffaf8be

Browse files
committed
stmhal: Add example use to RTC doc; add rtc.c to gendoc.py.
1 parent 3119b60 commit ffaf8be

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

stmhal/gendoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def main():
343343
args = cmd_parser.parse_args()
344344

345345
if len(args.files) == 0:
346-
args.files = ['modpyb.c', 'accel.c', 'adc.c', 'dac.c', 'extint.c', 'i2c.c', 'led.c', 'pin.c', 'rng.c', 'servo.c', 'spi.c', 'uart.c', 'usrsw.c', 'timer.c']
346+
args.files = ['modpyb.c', 'accel.c', 'adc.c', 'dac.c', 'extint.c', 'i2c.c', 'led.c', 'pin.c', 'rng.c', 'servo.c', 'spi.c', 'uart.c', 'usrsw.c', 'timer.c', 'rtc.c']
347347

348348
doc = Doc()
349349
for file in args.files:

stmhal/rtc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
///
1515
/// The RTC is and independent clock that keeps track of the date
1616
/// and time.
17+
///
18+
/// Example usage:
19+
///
20+
/// rtc = pyb.RTC()
21+
/// rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
22+
/// print(rtc.datetime())
1723

1824
RTC_HandleTypeDef RTCHandle;
1925

0 commit comments

Comments
 (0)