TA的每日心情 | 开心 2020-6-18 22:00 |
---|
签到天数: 1 天 [LV.1]初来乍到
管理员
  
- 积分
- 1645
|
数据更新:
libraries/AP_HAL_PX4/HAL_PX4_Class.cpp ---> void HAL_PX4::run(int argc, char * const argv[], Callbacks* callbacks) const
libraries/AP_HAL_PX4/HAL_PX4_Class.cpp ---> static int main_loop(int argc, char **argv)
{
hal.scheduler->init();
}
libraries/AP_HAL_PX4/Scheduler.cpp ---> void PX4Scheduler::init()
{
pthread_create(&_timer_thread_ctx, &thread_attr, &PX4Scheduler::_timer_thread, this);
}
libraries/AP_HAL_PX4/Scheduler.cpp ---> void *PX4Scheduler::_timer_thread(void *arg)
{
((PX4RCInput *)hal.rcin)->_timer_tick();
}
libraries/AP_HAL_PX4/RCInput.cpp ---> void PX4RCInput::_timer_tick(void)
{
orb_copy(ORB_ID(input_rc), _rc_sub, &_rcin);
}
数据使用:
ArduCopter/ArduCopter.cpp ---> void Copter::rc_loop()
{
read_radio();
}
ArduCopter/ArduCopter.cpp ---> void Copter::read_radio()
{
if (hal.rcin->new_input())
{
...
}
}
libraries/AP_HAL_PX4/RCInput.cpp ---> bool PX4RCInput::new_input()
{
bool valid = _rcin.timestamp_last_signal != _last_read;
return valid;
}
ArduCopter/ArduCopter.cpp ---> void Copter::read_radio()
{
if (hal.rcin->new_input())
{
RC_Channels::set_pwm_all();
radio_passthrough_to_motors();
}
}
|
|