* Extract time helpers from engine_controller_misc to efitime.cpp
* Rename currentTimeMillis() to getTimeNowMs()
We have getTimeNowNt(), getTimeNowUs(), currentTimeMillis() and getTimeNowSeconds()
Align a bit.
find . -type f -name '*.c*' -exec sed -i 's/currentTimeMillis/getTimeNowMs/g' {} \;
* Rename getTimeNowSeconds() to getTimeNowS()
To align with Nt, Us, Ms versions.
* Some comments about getTimeNowLowerNt()
The last version is already much better than the original, mostly because it doesn't call
CriticalSectionLocker, which has a ton of overhead due to debug tracking. But this version is
another 4 instructions / 12 bytes shorter. Does as much match in 32-bit land as possible, and
avoids math operations that span 64-bits (i.e. either operate on the lower half or upper half, but
not both). The result is only 3 instructions not including the necessary 4 loads (ptr to now, now,
ptr to upper, upper), 1 store (upper), and 1 return/branch.
Track the top two bits of the 32-bit time field, along with the bits that comprise the top half of
the 64-bit time field. We can detect when the 32-bit field is advancing or falling back from the
global time counter as long as the change is less than about 1 billion ticks. This shows up as
either 01 or 11 in the top 2 bits of the 32-bit time field relative to the 64-bit field. Or is
there is no change it shows up as 00. Changes of 2 billion or more cannot be discerned as +2
billion and -2 billion both show up as 10.
Change the simulator to use this logic to make sure it gets some exercise.
* remove simple cases
* more simple
* serial
* s
* more
* try memory
* easy
* mmc acc
* that's how much memory
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
* fix unregister api for gpio
* consumers
* guard with a critical section
* index
* guard less
* unregister under lock
* fix reinit
* dead flag
* fix most tests
* initialize properly
* initialize properly
* assertions in tests
* fix message
* move gpio mocking
* test gpios
* we must lock earlier to be truly safe
* this was using huge memory
* devirtualize
* test deinit
* remove old impl
* add cpp wrapper to os_access
* clean up os_access
* remove touchTimeCounter
* new impl
* put comment about lock free impl
* include cpp wrappers for BL
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
* change acSwitch name, add mode
* fix
* remove some adc stuff
* remove some adc stuff
* semicolon stupid
* left behind
* add readpinstate
* wrong var name
* add functions back
* fix name
* bool, not void, plus fix name
* move
* not sure what I broke
* try setMockValue
* namespace
* whoops missed one
* switch values because adc was set up for pullup
* try 5
* comment for now
* comment for now
* uncomment tests, add function to mock, add mock to efiReadPin
* fixes
* for F's sake
* if
* add defy
* pass params
* use ASSERT_TRUE/FALSE
* advance time
* remove ifdef from readPin
* try moving if
* move to separate func
* move extern
* move include
* try engine_test_helper
* am confuse
* move func to else
* include hal
* add efi prod check
* remove include
* try extern
* move include
* semicolon stupid
* move extern again
* include
* move mockPinStates
* size
* add if
* add comment
* clean on instantiation
* add tid field to thread
* change perf trace format
* trace consumers
* Update java parsing
* guard for test + kinetis
* stubs
* ram
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
* move hooks in to common
* but not for kinetis
* don't use c style void arg
* kinetis needed more, not less
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
* advance_map
* tests
* unneeded
* idle
* use driver intent instead
* and obd and lcd
* engine load
* ve lookup
* unused
* oops we needed that
* oops needed that too
* mocking
* test mocks
* oops
* helps to use the right sensor
* and cylinder cleanup
* fuel math
* typo
* old tests
* kill dead stuff
* cleanup
* more
* fix
* test
* s
* fix signature
* fix test
* comment
* priming pulse
* remove mock tps
* remove more dead
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
* proxy sensor
* header
* idle
* can
* settings
* remove old mocking
* remove old impl
* etb
* oops, gotta actually register it
* fix test
* structured bindings ftw!
* driver intent for stepper
* tear out old
* oops too much