Skip to content

STM32: Refactor us_ticker.c + hal_tick.c files #3213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Nov 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bb10409
Replace all devices us_ticker files with a common 16b and 32b file
bcostm Oct 25, 2016
4c7176f
Replace all devices hal_tick files with a common 16b and 32b version
bcostm Oct 25, 2016
68915b7
STM32F0 - Add the timer type used (16b or 32b) + periph clock in hal_…
bcostm Oct 25, 2016
a43e5b8
STM32F1 - Remove devices hal-tick files and update hal_tick.h
bcostm Oct 25, 2016
2488daf
STM21L0 - Remove devices hal_tick.c file and update hal_tick.h
bcostm Oct 25, 2016
16239f5
STM32L0 - Remove devices hal_tick.c files
bcostm Oct 25, 2016
ae858b4
STM32F0/F1/L0 - Update TIM_MST_GET_PCLK_FREQ macro
bcostm Oct 26, 2016
c3b8943
STM32L0 - Remove special treatment for reading the counter
bcostm Oct 26, 2016
ba8b33a
Minor changes
bcostm Oct 26, 2016
0524811
STM32xx - Remove hal_tick.c files and update hal_tick.h with new macro
bcostm Oct 26, 2016
3baaa76
STM32L1 - Don't use RepetitionCounter field in timer init
bcostm Oct 26, 2016
896293d
Replace TIM_MST_GET_PCLK_FREQ macro with TIM_MST_PCLK macro
bcostm Oct 26, 2016
a2e686b
Add volatile on one variable (alignment with 16bit file)
bcostm Oct 26, 2016
5895006
STM32L0 - Add patch done previously on these devices. This solves MBE…
bcostm Oct 26, 2016
6baec10
Rename files (remove stm_ prefix)
bcostm Oct 27, 2016
cc24e5b
Add initialization of timer instance in all functions
bcostm Oct 27, 2016
f8e18cd
Change TimMasterHandle variable declaration + typo corrections
bcostm Nov 2, 2016
777692c
Timer 16bit: Remove volatile variables. This solved many fails with M…
bcostm Nov 4, 2016
2006e45
Typo corrections (functions declaration)
bcostm Nov 14, 2016
da23ef1
Update license + date (same license as in mbed.h file)
bcostm Nov 14, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
******************************************************************************
* @file hal_tick.h
* @author MCD Application Team
* @brief Initialization of HAL tick
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
#ifndef __HAL_TICK_H
#define __HAL_TICK_H

#ifdef __cplusplus
extern "C" {
#endif

#include "stm32f0xx.h"
#include "cmsis_nvic.h"

#define TIM_MST TIM1
#define TIM_MST_UP_IRQ TIM1_BRK_UP_TRG_COM_IRQn
#define TIM_MST_OC_IRQ TIM1_CC_IRQn
#define TIM_MST_RCC __TIM1_CLK_ENABLE()

#define TIM_MST_RESET_ON __TIM1_FORCE_RESET()
#define TIM_MST_RESET_OFF __TIM1_RELEASE_RESET()

#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer

#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2)

#define HAL_TICK_DELAY (1000) // 1 ms

#ifdef __cplusplus
}
#endif

#endif // __HAL_TICK_H

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@
#define TIM_MST_RESET_ON __TIM1_FORCE_RESET()
#define TIM_MST_RESET_OFF __TIM1_RELEASE_RESET()

#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer

#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2)

#define HAL_TICK_DELAY (1000) // 1 ms


#ifdef __cplusplus
}
#endif
Expand Down
Loading