correct DMA
This commit is contained in:
parent
235fde6cdf
commit
08c7c57cef
2 changed files with 14 additions and 4 deletions
|
@ -9,10 +9,17 @@ extern "C" {
|
|||
}
|
||||
void DMA1_Channel1_IRQHandler( void ) {
|
||||
DMA1_Type::INTFR_DEF state (DMA1.INTFR);
|
||||
DMA1.INTFCR.R = state.R; // clear all
|
||||
if (!pInstance) return;
|
||||
if (state.B.HTIF1 != RESET) pInstance->send (false);
|
||||
else if (state.B.TCIF1 != RESET) pInstance->send (true);
|
||||
if (state.B.GIF1 != RESET) { // Zřejmě zbytečné, ale pokud používám víc DMA
|
||||
DMA1.INTFCR.B.CGIF1 = SET; // kanálů, pak to tak má být.
|
||||
} else return; // Událost nevznikla pro kanál 1.
|
||||
if (state.B.HTIF1 != RESET) {
|
||||
DMA1.INTFCR.B.CHTIF1 = SET;
|
||||
if (pInstance) pInstance->send (false);
|
||||
}
|
||||
if (state.B.TCIF1 != RESET) {
|
||||
DMA1.INTFCR.B.CTCIF1 = SET;
|
||||
if (pInstance) pInstance->send (true);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void EnableClock (void) noexcept {
|
||||
|
|
|
@ -41,6 +41,9 @@ static void InitPins () noexcept {
|
|||
void SpiClass::drq() {
|
||||
if (!driver) return;
|
||||
DMA1_Type::INTFR_DEF state (DMA1.INTFR);
|
||||
if (state.B.GIF3 != RESET) { // Zřejmě zbytečné, ale pokud používám víc DMA
|
||||
DMA1.INTFCR.B.CGIF3 = SET; // kanálů, pak to tak má být.
|
||||
} else return; // Událost nevznikla pro kanál 1.
|
||||
/*if (state.B.HTIF3) {
|
||||
DMA1.INTFCR.B.CHTIF3 = SET; // clear half
|
||||
} */
|
||||
|
|
Loading…
Reference in a new issue