mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 18:08:30 -04:00
HAL_VRBRAIN: added millis64() and micros64()
This commit is contained in:
parent
1241da466b
commit
071323a736
@ -76,14 +76,24 @@ void VRBRAINScheduler::init(void *unused)
|
||||
pthread_create(&_io_thread_ctx, &thread_attr, (pthread_startroutine_t)&VRBRAIN::VRBRAINScheduler::_io_thread, this);
|
||||
}
|
||||
|
||||
uint32_t VRBRAINScheduler::micros()
|
||||
uint64_t VRBRAINScheduler::micros64()
|
||||
{
|
||||
return (uint32_t)(hrt_absolute_time() - _sketch_start_time);
|
||||
return hrt_absolute_time() - _sketch_start_time;
|
||||
}
|
||||
|
||||
uint32_t VRBRAINScheduler::millis()
|
||||
uint64_t VRBRAINScheduler::millis64()
|
||||
{
|
||||
return hrt_absolute_time() / 1000;
|
||||
return micros64() / 1000;
|
||||
}
|
||||
|
||||
uint32_t VRBRAINScheduler::micros()
|
||||
{
|
||||
return micros64() & 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
uint32_t VRBRAINScheduler::millis()
|
||||
{
|
||||
return millis64() & 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,6 +29,8 @@ public:
|
||||
void delay(uint16_t ms);
|
||||
uint32_t millis();
|
||||
uint32_t micros();
|
||||
uint64_t millis64();
|
||||
uint64_t micros64();
|
||||
void delay_microseconds(uint16_t us);
|
||||
void register_delay_callback(AP_HAL::Proc, uint16_t min_time_ms);
|
||||
void register_timer_process(AP_HAL::MemberProc);
|
||||
|
Loading…
Reference in New Issue
Block a user