MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / _irq_handler

Method _irq_handler

libraries/AP_HAL_ChibiOS/SoftSigReaderInt.cpp:99–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void SoftSigReaderInt::_irq_handler(EICUDriver *eicup, eicuchannel_t aux_channel)
100{
101 eicuchannel_t channel = get_pair_channel(aux_channel);
102 pulse_t pulse;
103 pulse.w0 = eicup->tim->CCR[channel];
104 pulse.w1 = eicup->tim->CCR[aux_channel];
105
106 _singleton->sigbuf.push(pulse);
107
108 //check for missed interrupt
109 uint32_t mask = (STM32_TIM_SR_CC1OF << channel) | (STM32_TIM_SR_CC1OF << aux_channel);
110 if ((eicup->tim->SR & mask) != 0) {
111 //we have missed some pulses
112 //try to reset RCProtocol parser by returning invalid value (i.e. 0 width pulse)
113 pulse.w0 = 0;
114 pulse.w1 = 0;
115 _singleton->sigbuf.push(pulse);
116 //reset overcapture mask
117 eicup->tim->SR &= ~mask;
118 }
119}
120
121bool SoftSigReaderInt::read(uint32_t &widths0, uint32_t &widths1)
122{

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected