HAL_ChibiOS: run can loop much more often

this allows for much higher ESC and servo rates, as it gives more
changes for frames to get out
This commit is contained in:
Andrew Tridgell 2018-05-24 20:21:43 +10:00
parent 0dc77421e8
commit afb36ec168
3 changed files with 3 additions and 6 deletions

View File

@ -76,8 +76,6 @@ void CANManager::_timer_tick()
if (p_uavcan != nullptr) {
p_uavcan->do_cyclic();
} else {
hal.console->printf("p_uavcan is nullptr");
}
}

View File

@ -36,7 +36,6 @@
#define MAX_NUMBER_OF_CAN_DRIVERS 2
#define CAN_STM32_RX_QUEUE_SIZE 64
class AP_UAVCAN;
using namespace uavcan_stm32;
namespace ChibiOS {
/**
@ -76,8 +75,8 @@ private:
AP_UAVCAN *p_uavcan;
bool initialized_;
uint32_t bitrate_;
CanInitHelper<CAN_STM32_RX_QUEUE_SIZE> can_helper;
uavcan_stm32::CanInitHelper<CAN_STM32_RX_QUEUE_SIZE> can_helper;
};
}
#endif
#endif

View File

@ -313,7 +313,7 @@ void Scheduler::_uavcan_thread(void *arg)
sched->delay_microseconds(20000);
}
while (true) {
sched->delay_microseconds(1000);
sched->delay_microseconds(100);
for (int i = 0; i < MAX_NUMBER_OF_CAN_INTERFACES; i++) {
if(hal.can_mgr[i] != nullptr) {
CANManager::from(hal.can_mgr[i])->_timer_tick();