Interrupt counters added (use -DDEBUG_INTERRUPTS=YES to enable and CLI command "print int" to see them)

This commit is contained in:
Damjan Adamic
2016-04-03 17:51:20 +02:00
parent a0b4053e82
commit 9673df83a7
21 changed files with 188 additions and 52 deletions
@@ -120,6 +120,7 @@ void audioEnd()
extern "C" void AUDIO_TIM_IRQHandler()
{
DEBUG_INTERRUPT(INT_AUDIO);
DAC->CR &= ~DAC_CR_DMAEN1 ; // Stop DMA requests
#if !defined(REV9E)
DAC->CR &= ~DAC_CR_DMAUDRIE1 ; // Stop underrun interrupt
@@ -104,6 +104,7 @@ void bluetoothDone()
extern "C" void USART6_IRQHandler(void)
{
DEBUG_INTERRUPT(INT_BLUETOOTH);
if (USART_GetITStatus(BT_USART, USART_IT_RXNE) != RESET) {
USART_ClearITPendingBit(BT_USART, USART_IT_RXNE);
uint8_t byte = USART_ReceiveData(BT_USART);
@@ -108,6 +108,7 @@ extern "C" void INTERRUPT_5MS_IRQHandler()
{
INTERRUPT_5MS_TIMER->SR &= ~TIM_SR_UIF ;
interrupt5ms() ;
DEBUG_INTERRUPT(INT_5MS);
}
#if defined(REV9E)
+21 -20
View File
@@ -1,23 +1,23 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "../../opentx.h"
#define WriteData(x) AspiData(x)
@@ -199,6 +199,7 @@ void lcdRefresh(bool wait)
extern "C" void DMA1_Stream7_IRQHandler()
{
DEBUG_INTERRUPT(INT_LCD);
//clear interrupt flag
DMA1_Stream7->CR &= ~DMA_SxCR_TCIE ; // Stop interrupt
DMA1->HIFCR |= DMA_HIFCR_CTCIF7; // Clear interrupt flag
@@ -375,6 +375,7 @@ static void intmodulePpmStop()
#if !defined(SIMU)
extern "C" void TIM1_CC_IRQHandler()
{
DEBUG_INTERRUPT(INT_TIM1CC);
INTMODULE_TIMER->DIER &= ~TIM_DIER_CC2IE; // stop this interrupt
INTMODULE_TIMER->SR &= ~TIM_SR_CC2IF; // clear flag
DMA2_Stream6->CR &= ~DMA_SxCR_EN; // disable DMA, it will have the whole of the execution time of setupPulses() to actually stop
@@ -402,6 +403,7 @@ extern "C" void TIM1_CC_IRQHandler()
extern "C" void TIM1_UP_TIM10_IRQHandler()
{
DEBUG_INTERRUPT(INT_TIM1);
INTMODULE_TIMER->SR &= ~TIM_SR_UIF ; // Clear flag
INTMODULE_TIMER->ARR = *modulePulsesData[INTERNAL_MODULE].ppm.ptr++ ;
@@ -612,6 +614,7 @@ extern "C" void TIM8_CC_IRQHandler()
extern "C" void TIM8_UP_TIM13_IRQHandler()
{
DEBUG_INTERRUPT(INT_TIM8);
EXTMODULE_TIMER->SR &= ~TIM_SR_UIF ; // Clear flag
EXTMODULE_TIMER->ARR = *modulePulsesData[EXTERNAL_MODULE].ppm.ptr++ ;
@@ -138,6 +138,7 @@ uint8_t serial2TracesEnabled()
#if !defined(SIMU)
extern "C" void SERIAL_USART_IRQHandler(void)
{
DEBUG_INTERRUPT(INT_SER2);
// Send
if (USART_GetITStatus(SERIAL_USART, USART_IT_TXE) != RESET) {
uint8_t txchar;
@@ -114,6 +114,7 @@ void sportSendBuffer(uint8_t * buffer, uint32_t count)
extern "C" void TELEMETRY_DMA_TX_IRQHandler(void)
{
DEBUG_INTERRUPT(INT_TELEM_DMA);
if (DMA_GetITStatus(TELEMETRY_DMA_Stream_TX, TELEMETRY_DMA_TX_FLAG_TC)) {
DMA_ClearITPendingBit(TELEMETRY_DMA_Stream_TX, TELEMETRY_DMA_TX_FLAG_TC);
telemetryPortSetDirectionInput();
@@ -123,6 +124,7 @@ extern "C" void TELEMETRY_DMA_TX_IRQHandler(void)
#define USART_FLAG_ERRORS (USART_FLAG_ORE | USART_FLAG_NE | USART_FLAG_FE | USART_FLAG_PE)
extern "C" void TELEMETRY_USART_IRQHandler(void)
{
DEBUG_INTERRUPT(INT_TELEM_USART);
uint32_t status = TELEMETRY_USART->SR;
while (status & (USART_FLAG_RXNE | USART_FLAG_ERRORS)) {
uint8_t data = TELEMETRY_USART->DR;
@@ -103,6 +103,7 @@ void stop_trainer_capture()
#if !defined(SIMU)
extern "C" void TIM3_IRQHandler()
{
DEBUG_INTERRUPT(INT_TRAINER);
uint16_t capture = 0;
bool doCapture = false;
+2
View File
@@ -20,6 +20,7 @@
#include "board_taranis.h"
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd_int.h"
#include "debug.h"
int usbPlugged(void)
{
@@ -46,6 +47,7 @@ USB_OTG_CORE_HANDLE USB_OTG_dev;
void OTG_FS_IRQHandler(void)
{
DEBUG_INTERRUPT(INT_OTG_FS);
USBD_OTG_ISR_Handler(&USB_OTG_dev);
}