8000 emulation on host: millis()/micros() now start at 0 by d-a-v · Pull Request #7810 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

emulation on host: millis()/micros() now start at 0 #7810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify
  • Loading branch information
d-a-v committed Jan 5, 2021
commit 0b008c33f1a1ebaa3662b344deb18cabaad7fb81
5 changes: 0 additions & 5 deletions tests/host/common/Arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@

static struct timeval gtod0 = { 0, 0 };

void mockInitMillisMicros ()
{
gettimeofday(&gtod0, nullptr);
}

extern "C" unsigned long millis()
{
if (gtod0.tv_sec == 0)
Expand Down
4 changes: 2 additions & 2 deletions tests/host/common/ArduinoMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ int main (int argc, char* const argv [])
// install exit handler in case Esp.restart() is called
atexit(cleanup);

// now is millis() and micros() beginning
mockInitMillisMicros();
// first call to millis(): now is millis() and micros() beginning
millis();

setup();
while (!user_exit)
Expand Down
1 change: 0 additions & 1 deletion tests/host/common/mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ int ets_printf (const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
#define os_printf_plus printf
#define ets_vsnprintf vsnprintf

void mockInitMillisMicros ();
int mockverbose (const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));

extern const char* host_interface; // cmdline parameter
Expand Down
0