mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 21:14:01 +08:00
* complie boardd without python
* not good, but don't want to lose the file, because it works
* clean a bit
* update dbc
* should build on CI
* not good, but don't want to lose the file, because it works
* clean a bit
* should build on CI
* remove unneeded path
* reorder paths
* reduce diff
* and now it works?!
* ... should work in CI
* add kj, 30% chance to fix macos
* pydebug
* new way to find path
* fix :)
* tested
* sanity check
* repl. MacOS flags
* hope it works
* need more logs
* need more logs2
* test if it works
* should work on CI
* correct python file
* should not work
* cleanup
* real cleanup
* more removals
* 50% of file
* transformations
* fixed a hardcoded variable
* more logs
* simpl.
* kalman
* all donw if it passes tests
* cleanup
* reduce code by 20 lines if this works
* fix bugs
* cleanup
* SharedLibrary
* cleanup
* ...
* remove unused
* CI fix maybe?
* add more valid path
* more logs
* ...:
* fix webcam CI
* remove WError flag
* deprecated is not an error
* more Wno things
* reduce diff, add Wno to env
* don't import nonexistent stuff
* SharedLibrary v2
* less custom env
* renaming, remove SharedLibs
* pack libs in envCython
* experiment
* better docker caching
* whitespace
* more docker caching
* improvement
* improvements
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 9529764549
25 lines
602 B
Cython
25 lines
602 B
Cython
# distutils: language = c++
|
|
# cython: language_level = 3
|
|
from posix.time cimport clock_gettime, timespec, CLOCK_MONOTONIC_RAW, clockid_t
|
|
|
|
IF UNAME_SYSNAME == "Darwin":
|
|
# Darwin doesn't have a CLOCK_BOOTTIME
|
|
CLOCK_BOOTTIME = CLOCK_MONOTONIC_RAW
|
|
ELSE:
|
|
from posix.time cimport CLOCK_BOOTTIME
|
|
|
|
cdef double readclock(clockid_t clock_id):
|
|
cdef timespec ts
|
|
cdef double current
|
|
|
|
clock_gettime(clock_id, &ts)
|
|
current = ts.tv_sec + (ts.tv_nsec / 1000000000.)
|
|
return current
|
|
|
|
def monotonic_time():
|
|
return readclock(CLOCK_MONOTONIC_RAW)
|
|
|
|
def sec_since_boot():
|
|
return readclock(CLOCK_BOOTTIME)
|
|
|