diff options
Diffstat (limited to 'Project/src/stm32f0xx_it.c')
-rw-r--r-- | Project/src/stm32f0xx_it.c | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/Project/src/stm32f0xx_it.c b/Project/src/stm32f0xx_it.c index b628455..9327bed 100644 --- a/Project/src/stm32f0xx_it.c +++ b/Project/src/stm32f0xx_it.c @@ -1,11 +1,11 @@ /** ****************************************************************************** - * @file Projects\Demonstration\stm32f0xx_it.c + * @file Projects\Demonstration\stm32f0xx_it.c * @author MCD Application Team * @version V1.0.0 * @date 17-January-2014 * @brief Main Interrupt Service Routines. - * This file provides template for all exceptions handler and + * This file provides template for all exceptions handler and * peripherals interrupt service routine. ****************************************************************************** * @attention @@ -18,14 +18,14 @@ * * http://www.st.com/software_license_agreement_liberty_v2 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** - */ + */ /* Includes ------------------------------------------------------------------*/ #include "stm32f0xx_it.h" @@ -86,7 +86,7 @@ void HardFault_Handler(void) * @brief This function handles SVCall exception. * @param None * @retval None - * @ portasm.s + * @ Используется в файле portasm.s */ //void SVC_Handler(void) //{ @@ -96,7 +96,7 @@ void HardFault_Handler(void) * @brief This function handles PendSVC exception. * @param None * @retval None - * @ portasm.s + * @ Используется в файле portasm.s */ //void PendSV_Handler(void) //{ @@ -121,16 +121,15 @@ void HardFault_Handler(void) /******************************************************************************/ // ---------------------------------------------------------------------------- -// 1 +// Обработчик прерывания таймера общего назначения для тиков в 1 мс // ---------------------------------------------------------------------------- void LTIMER_IRQHandler ( void ) { if ( TIM_GetITStatus ( LTIMER_TIMx, TIM_IT_Update ) != RESET ) - { + { TIM_ClearITPendingBit ( LTIMER_TIMx, TIM_IT_Update ); - + ProcessLTimers (); - //NIX_TEST_PIN_PB11_TOGGLE; } } @@ -138,16 +137,16 @@ void TIM17_handler(void) { LTIMER_IRQHandler(); } // ---------------------------------------------------------------------------- -// NixieDriver -// , -// Nixie +// Обработчик прерывания таймера для работы NixieDriver +// Это прерывание имеет самый высокий приоритет, чтобы обеспечить стабильную +// частоту динамической индикации ламп Nixie // ---------------------------------------------------------------------------- void NIX_DRIVER_TIM_IRQHandler ( void ) { if ( TIM_GetITStatus ( NIX_DRIVER_TIMx, TIM_IT_Update ) != RESET ) - { + { TIM_ClearITPendingBit ( NIX_DRIVER_TIMx, TIM_IT_Update ); - + ProcessNixieDriverFromISR (); } } @@ -156,14 +155,14 @@ void TIM16_handler(void) { NIX_DRIVER_TIM_IRQHandler(); } // ---------------------------------------------------------------------------- -// LED_Driver +// Обработчик прерывания таймера для работы LED_Driver // ---------------------------------------------------------------------------- void LED_TIM_IRQHandler ( void ) { if ( TIM_GetITStatus ( LED_TIMx, TIM_IT_Update ) != RESET ) - { + { TIM_ClearITPendingBit ( LED_TIMx, TIM_IT_Update ); - + LEDDriverProcessFromISR (); } } @@ -172,21 +171,20 @@ void TIM3_handler(void) { LED_TIM_IRQHandler(); } // ---------------------------------------------------------------------------- -// - , 2 -// ( ? -// ?) +// - поставить этому прерыванию наивысший приоритет, чтобы передавать 2 байта +// подряд гарантированно без промежутка времени (или не так важно? может ли +// между двумя байтами задержка повлиять на вывод данных на лампы?) // ---------------------------------------------------------------------------- -//static uint16_t empty_data; void NIX_SPIx_IRQHandler ( void ) -{ +{ /* SPI in Master Receiver mode--------------------------------------- */ if ( SPI_I2S_GetITStatus ( NIX_SPIx, SPI_I2S_IT_TXE ) == SET ) { - // , + // Обязательно надо считать, чтобы сбросить флаг SPI_I2S_ReceiveData16 ( NIX_SPIx ); SPI_I2S_ITConfig ( NIX_SPIx, SPI_I2S_IT_TXE, DISABLE ); - //NixieDriverCheckDPPins(); + //NixieDriverCheckDPPins(); NIX_DRIVER_SET_ST_PIN; } } @@ -199,13 +197,13 @@ void SPI1_handler(void) { NIX_SPIx_IRQHandler(); } // ---------------------------------------------------------------------------- #ifdef LED_DRIVER void LED_SPIx_IRQHandler ( void ) -{ +{ /* SPI in Master Receiver mode--------------------------------------- */ if ( SPI_I2S_GetITStatus ( LED_SPIx, SPI_I2S_IT_RXNE ) == SET ) { - //empty_data = SPI_I2S_ReceiveData16 ( LED_SPIx ); - // , - SPI_I2S_ReceiveData16 ( LED_SPIx ); + //empty_data = SPI_I2S_ReceiveData16 ( LED_SPIx ); + // Обязательно надо считать, чтобы сбросить флаг + SPI_I2S_ReceiveData16 ( LED_SPIx ); LED_ST_PIN_SET; } } |