1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-03 11:24:10 +01:00
LibrePilot/flight/Bootloaders/OpenPilot/stm32f10x_it.c
zedamota 002c746076 OP-21/Bootloader deleted old one, commited new one. Partly functional, but slow due to current packet size.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1378 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-22 19:51:55 +00:00

316 lines
11 KiB
C

/******************** (C) COPYRIGHT 2010 STMicroelectronics ********************
* File Name : stm32f10x_it.c
* Author : MCD Application Team
* Version : V3.2.1
* Date : 07/05/2010
* Description : Main Interrupt Service Routines.
* This file provides template for all exceptions handler
* and peripherals interrupt service routine.
********************************************************************************
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "platform_config.h"
#include "stm32f10x_it.h"
#include "usb_lib.h"
#include "usb_istr.h"
#include "usb_pwr.h"
#include "stm32_eval.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
__IO uint8_t Send_Buffer[2];
extern uint32_t ADC_ConvertedValueX;
extern uint32_t ADC_ConvertedValueX_1;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/******************************************************************************/
/* Cortex-M3 Processor Exceptions Handlers */
/******************************************************************************/
/*******************************************************************************
* Function Name : NMI_Handler
* Description : This function handles NMI exception.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void NMI_Handler(void)
{
}
/*******************************************************************************
* Function Name : HardFault_Handler
* Description : This function handles Hard Fault exception.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void HardFault_Handler(void)
{
/* Go to infinite loop when Hard Fault exception occurs */
while (1)
{
}
}
/*******************************************************************************
* Function Name : MemManage_Handler
* Description : This function handles Memory Manage exception.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void MemManage_Handler(void)
{
/* Go to infinite loop when Memory Manage exception occurs */
while (1)
{
}
}
/*******************************************************************************
* Function Name : BusFault_Handler
* Description : This function handles Bus Fault exception.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void BusFault_Handler(void)
{
/* Go to infinite loop when Bus Fault exception occurs */
while (1)
{
}
}
/*******************************************************************************
* Function Name : UsageFault_Handler
* Description : This function handles Usage Fault exception.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void UsageFault_Handler(void)
{
/* Go to infinite loop when Usage Fault exception occurs */
while (1)
{
}
}
/*******************************************************************************
* Function Name : SVC_Handler
* Description : This function handles SVCall exception.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void SVC_Handler(void)
{
}
/*******************************************************************************
* Function Name : DebugMon_Handler
* Description : This function handles Debug Monitor exception.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void DebugMon_Handler(void)
{
}
/*******************************************************************************
* Function Name : PendSV_Handler
* Description : This function handles PendSVC exception.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void PendSV_Handler(void)
{
}
/*******************************************************************************
* Function Name : SysTick_Handler
* Description : This function handles SysTick Handler.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void SysTick_Handler(void)
{
}
/******************************************************************************/
/* STM32F10x Peripherals Interrupt Handlers */
/******************************************************************************/
#ifndef STM32F10X_CL
/*******************************************************************************
* Function Name : USB_LP_CAN1_RX0_IRQHandler
* Description : This function handles USB Low Priority or CAN RX0 interrupts
* requests.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void USB_LP_CAN1_RX0_IRQHandler(void)
{
USB_Istr();
}
#endif /* STM32F10X_CL */
/*******************************************************************************
* Function Name : DMA1_Channel1_IRQHandler
* Description : This function handles DMA1 Channel 1 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void DMA1_Channel1_IRQHandler(void)
{
while (1)
{
}
//TODO CLEAN
Send_Buffer[0] = 0x07;
if((ADC_ConvertedValueX >>4) - (ADC_ConvertedValueX_1 >>4) > 4)
{
Send_Buffer[1] = (uint8_t)(ADC_ConvertedValueX >>4);
/* Write the descriptor through the endpoint */
USB_SIL_Write(EP1_IN, (uint8_t*) Send_Buffer, 2);
#ifndef STM32F10X_CL
SetEPTxValid(ENDP1);
#endif /* STM32F10X_CL */
ADC_ConvertedValueX_1 = ADC_ConvertedValueX;
}
DMA_ClearFlag(DMA1_FLAG_TC1);
}
/*******************************************************************************
* Function Name : EXTI9_5_IRQHandler
* Description : This function handles External lines 9 to 5 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void EXTI9_5_IRQHandler(void)
{
while (1)
{
}
//TODO CLEAN
if(EXTI_GetITStatus(KEY_BUTTON_EXTI_LINE) != RESET)
{
Send_Buffer[0] = 0x05;
if (STM_EVAL_PBGetState(Button_KEY) == Bit_RESET)
{
Send_Buffer[1] = 0x01;
}
else
{
Send_Buffer[1] = 0x00;
}
/* Write the descriptor through the endpoint */
USB_SIL_Write(EP1_IN, (uint8_t*) Send_Buffer, 2);
#ifndef STM32F10X_CL
SetEPTxValid(ENDP1);
#endif /* STM32F10X_CL */
/* Clear the EXTI line pending bit */
EXTI_ClearITPendingBit(KEY_BUTTON_EXTI_LINE);
}
}
/*******************************************************************************
* Function Name : EXTI15_10_IRQHandler
* Description : This function handles External lines 15 to 10 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void EXTI15_10_IRQHandler(void)
{
while (1)
{
}
//TODO CLEAN
if(EXTI_GetITStatus(TAMPER_BUTTON_EXTI_LINE) != RESET)
{
Send_Buffer[0] = 0x06;
if (STM_EVAL_PBGetState(Button_TAMPER) == Bit_RESET)
{
Send_Buffer[1] = 0x01;
}
else
{
Send_Buffer[1] = 0x00;
}
/* Write the descriptor through the endpoint */
USB_SIL_Write(EP1_IN, (uint8_t*) Send_Buffer, 2);
#ifndef STM32F10X_CL
SetEPTxValid(ENDP1);
#endif /* STM32F10X_CL */
/* Clear the EXTI line 13 pending bit */
EXTI_ClearITPendingBit(TAMPER_BUTTON_EXTI_LINE);
}
}
#ifdef STM32F10X_CL
/*******************************************************************************
* Function Name : OTG_FS_IRQHandler
* Description : This function handles USB-On-The-Go FS global interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void OTG_FS_IRQHandler(void)
{
STM32_PCD_OTG_ISR_Handler();
}
#endif /* STM32F10X_CL */
/******************************************************************************/
/* STM32F10x Peripherals Interrupt Handlers */
/* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
/* available peripheral interrupt handler's name please refer to the startup */
/* file (startup_stm32f10x_xx.s). */
/******************************************************************************/
/*******************************************************************************
* Function Name : PPP_IRQHandler
* Description : This function handles PPP interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
/*void PPP_IRQHandler(void)
{
}*/
/******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/