File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,12 @@ static int rtctime_set (lua_State *L)
144
144
return 0 ;
145
145
}
146
146
147
+ static int rtctime_set_rate (lua_State * L )
148
+ {
149
+ rtc_time_set_rate (luaL_checkinteger (L , 1 ));
150
+ return 0 ;
151
+ }
152
+
147
153
// sec, usec = rtctime.get ()
148
154
static int rtctime_get (lua_State * L )
149
155
{
@@ -229,6 +235,7 @@ static int rtctime_epoch2cal (lua_State *L)
229
235
// Module function map
230
236
LROT_BEGIN (rtctime , NULL , 0 )
231
237
LROT_FUNCENTRY ( set , rtctime_set )
238
+ LROT_FUNCENTRY ( set_rate , rtctime_set_rate )
232
239
LROT_FUNCENTRY ( get , rtctime_get )
233
240
LROT_FUNCENTRY ( adjust_delta , rtctime_adjust_delta )
234
241
LROT_FUNCENTRY ( dsleep , rtctime_dsleep )
Original file line number Diff line number Diff line change @@ -158,6 +158,12 @@ rtctime.set(1436430589, 0)
158
158
#### See also
159
159
[ ` sntp.sync() ` ] ( sntp.md#sntpsync )
160
160
161
+ ## rtctime.set_rate()
162
+ Adjust the RTC rate, as per [ ` rtctime.set() ` ] ( #rtctimeset ) , but without also setting the time.
163
+
164
+ #### Syntax
165
+ ` rtctime.set_rate(rate) `
166
+
161
167
## rtctime.adjust_delta()
162
168
163
169
This takes a time interval in 'system clock microseconds' based on the timestamps returned by ` tmr.now ` and returns
Original file line number Diff line number Diff line change @@ -540,7 +540,8 @@ stds.nodemcu_libs = {
540
540
dsleep_aligned = empty ,
541
541
epoch2cal = empty ,
542
542
get = empty ,
543
- set = empty
543
+ set = empty ,
544
+ set_rate = empty
544
545
}
545
546
},
546
547
si7021 = {
You can’t perform that action at this time.
0 commit comments