Skip to content

Commit

Permalink
Merge pull request #29 from Sympatron/bare-metal
Browse files Browse the repository at this point in the history
Bare metal fixes
  • Loading branch information
sidcha authored Nov 11, 2024
2 parents 01950bf + 8386068 commit 3f7a259
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ static inline void logger_log_set_color(logger_t *ctx, const char *color)
assert(ret == len);
ARG_UNUSED(ret); /* squash warning in Release builds */
}
#else
ARG_UNUSED(ctx);
ARG_UNUSED(color);
#endif
}

Expand Down
7 changes: 7 additions & 0 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,24 +150,31 @@ int add_iso8601_utc_datetime(char *buf, size_t size)

#elif defined(__BARE_METAL__)

#ifndef _TIMEVAL_DEFINED
struct timeval {
long tv_sec; // seconds since epoch
long tv_usec; // microseconds
};
#endif

#ifndef _TIMEZONE_DEFINED
struct timezone {
int tz_minuteswest; // minutes west of UTC
int tz_dsttime; // daylight saving time flag
};
#endif

int gettimeofday(struct timeval * tp, struct timezone * tzp)
{
ARG_UNUSED(tzp);
tp->tv_sec = 0;
tp->tv_usec = 0;
return 0;
}

int add_iso8601_utc_datetime(char* buf, size_t size) {
ARG_UNUSED(buf);
ARG_UNUSED(size);
return 0;
}

Expand Down

0 comments on commit 3f7a259

Please sign in to comment.