mirror of https://github.com/rusefi/bldc.git
Added system_time_ticks to C interface
This commit is contained in:
parent
fd958d59a2
commit
4b15ea9385
|
@ -611,6 +611,10 @@ typedef struct {
|
|||
// Unblock unboxed
|
||||
bool (*lbm_unblock_ctx_unboxed)(lbm_cid cid, lbm_value unboxed);
|
||||
|
||||
// Time since boot in system ticks. Resolution: 100 uS.
|
||||
// Use ts_to_age_s to get the age of a timestamp in
|
||||
// seconds. ts_to_age_s should hanlde overflows.
|
||||
systime_t (*system_time_ticks)(void);
|
||||
} vesc_c_if;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -932,6 +932,9 @@ lbm_value ext_load_native_lib(lbm_value *args, lbm_uint argn) {
|
|||
// Unblock unboxed
|
||||
cif.cif.lbm_unblock_ctx_unboxed = lbm_unblock_ctx_unboxed;
|
||||
|
||||
// System time
|
||||
cif.cif.system_time_ticks = chVTGetSystemTimeX;
|
||||
|
||||
lib_init_done = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue