Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions src/lmic/oslmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,10 @@ bit_t os_queryTimeCriticalJobs(ostime_t time) {
else
return 0;
}

ostime_t os_timeToNextTimeCriticalJob() {
if (OS.runnablejobs) return 0;

if (!OS.scheduledjobs) return 0x7FFFFFFFl;//ostime_t_max;
return OS.scheduledjobs->deadline - os_getTime();
}
4 changes: 4 additions & 0 deletions src/lmic/oslmic.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ u1_t os_getBattLevel (void);
//! Return non-zero if any jobs are scheduled between now and now+time.
bit_t os_queryTimeCriticalJobs(ostime_t time);
#endif
#ifndef os_timeToNextTimeCriticalJob
// return the time to the next scheduled job, or ostime_t_max if no job is scheduled
ostime_t os_timeToNextTimeCriticalJob();
#endif

#ifndef os_rlsbf4
//! Read 32-bit quantity from given pointer in little endian byte order.
Expand Down