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

Method _irq_handler

libraries/AP_HAL_ChibiOS/SoftSigReader.cpp:101–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void SoftSigReader::_irq_handler(void* self, uint32_t flags)
102{
103 SoftSigReader* sig_reader = (SoftSigReader*)self;
104 // we need to restart the DMA as quickly as possible to prevent losing pulses, so we
105 // make a fixed length copy to a 2nd buffer. On the F100 this reduces the time with DMA
106 // disabled from 20us to under 1us
107 stm32_cacheBufferInvalidate(sig_reader->signal, SOFTSIG_BOUNCE_BUF_SIZE*4);
108 memcpy(sig_reader->signal2, sig_reader->signal, SOFTSIG_BOUNCE_BUF_SIZE*4);
109 //restart the DMA transfers
110 dmaStreamDisable(sig_reader->dma);
111 dmaStreamSetPeripheral(sig_reader->dma, &sig_reader->_icu_drv->tim->DMAR);
112 dmaStreamSetMemory0(sig_reader->dma, sig_reader->signal);
113 dmaStreamSetTransactionSize(sig_reader->dma, SOFTSIG_BOUNCE_BUF_SIZE);
114 dmaStreamSetMode(sig_reader->dma, sig_reader->dmamode);
115 dmaStreamEnable(sig_reader->dma);
116 sig_reader->sigbuf.push((const pulse_t *)sig_reader->signal2, SOFTSIG_BOUNCE_BUF_SIZE/2);
117}
118
119
120#endif // HAL_USE_ICU

Callers

nothing calls this directly

Calls 3

memcpyFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected