Skip to content

Commit

Permalink
AP_Scheduler: use millis/micros/panic functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarcelo authored and rmackay9 committed Nov 20, 2015
1 parent 82a14b1 commit 81186e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions libraries/AP_Scheduler/AP_Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void AP_Scheduler::tick(void)
*/
void AP_Scheduler::run(uint16_t time_available)
{
uint32_t run_started_usec = hal.scheduler->micros();
uint32_t run_started_usec = AP_HAL::micros();
uint32_t now = run_started_usec;

for (uint8_t i=0; i<_num_tasks; i++) {
Expand Down Expand Up @@ -97,7 +97,7 @@ void AP_Scheduler::run(uint16_t time_available)
_last_run[i] = _tick_counter;

// work out how long the event actually took
now = hal.scheduler->micros();
now = AP_HAL::micros();
uint32_t time_taken = now - _task_time_started;

if (time_taken > _task_time_allowed) {
Expand Down Expand Up @@ -134,7 +134,7 @@ void AP_Scheduler::run(uint16_t time_available)
*/
uint16_t AP_Scheduler::time_available_usec(void)
{
uint32_t dt = hal.scheduler->micros() - _task_time_started;
uint32_t dt = AP_HAL::micros() - _task_time_started;
if (dt > _task_time_allowed) {
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ void SchedTest::ins_update(void)
*/
void SchedTest::one_hz_print(void)
{
hal.console->printf("one_hz: t=%lu\n", (unsigned long)hal.scheduler->millis());
hal.console->printf("one_hz: t=%lu\n", (unsigned long)AP_HAL::millis());
}

/*
print something every 5 seconds
*/
void SchedTest::five_second_call(void)
{
hal.console->printf("five_seconds: t=%lu ins_counter=%u\n", (unsigned long)hal.scheduler->millis(), ins_counter);
hal.console->printf("five_seconds: t=%lu ins_counter=%u\n", (unsigned long)AP_HAL::millis(), ins_counter);
}

/*
Expand Down

0 comments on commit 81186e5

Please sign in to comment.