mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 13:25:30 +03:00
Tidy up ints.
This commit is contained in:
parent
801ebd4a58
commit
25b3f5b5ea
2 changed files with 8 additions and 8 deletions
|
@ -199,7 +199,7 @@ static inline uint8_t lookupChannelIndex(const uint16_t channel)
|
||||||
|
|
||||||
rccPeriphTag_t timerRCC(TIM_TypeDef *tim)
|
rccPeriphTag_t timerRCC(TIM_TypeDef *tim)
|
||||||
{
|
{
|
||||||
for (uint8_t i = 0; i < HARDWARE_TIMER_DEFINITION_COUNT; i++) {
|
for (int i = 0; i < HARDWARE_TIMER_DEFINITION_COUNT; i++) {
|
||||||
if (timerDefinitions[i].TIMx == tim) {
|
if (timerDefinitions[i].TIMx == tim) {
|
||||||
return timerDefinitions[i].rcc;
|
return timerDefinitions[i].rcc;
|
||||||
}
|
}
|
||||||
|
@ -686,12 +686,12 @@ void timerInit(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* enable the timer peripherals */
|
/* enable the timer peripherals */
|
||||||
for (uint8_t i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
||||||
RCC_ClockCmd(timerRCC(timerHardware[i].tim), ENABLE);
|
RCC_ClockCmd(timerRCC(timerHardware[i].tim), ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(STM32F3) || defined(STM32F4)
|
#if defined(STM32F3) || defined(STM32F4)
|
||||||
for (uint8_t timerIndex = 0; timerIndex < USABLE_TIMER_CHANNEL_COUNT; timerIndex++) {
|
for (int timerIndex = 0; timerIndex < USABLE_TIMER_CHANNEL_COUNT; timerIndex++) {
|
||||||
const timerHardware_t *timerHardwarePtr = &timerHardware[timerIndex];
|
const timerHardware_t *timerHardwarePtr = &timerHardware[timerIndex];
|
||||||
IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), IOCFG_AF_PP, timerHardwarePtr->alternateFunction);
|
IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), IOCFG_AF_PP, timerHardwarePtr->alternateFunction);
|
||||||
}
|
}
|
||||||
|
@ -757,7 +757,7 @@ void timerForceOverflow(TIM_TypeDef *tim)
|
||||||
|
|
||||||
const timerHardware_t *timerGetByTag(ioTag_t tag, timerUsageFlag_e flag)
|
const timerHardware_t *timerGetByTag(ioTag_t tag, timerUsageFlag_e flag)
|
||||||
{
|
{
|
||||||
for (uint8_t i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
||||||
if (timerHardware[i].tag == tag) {
|
if (timerHardware[i].tag == tag) {
|
||||||
if (timerHardware[i].usageFlags & flag) {
|
if (timerHardware[i].usageFlags & flag) {
|
||||||
return &timerHardware[i];
|
return &timerHardware[i];
|
||||||
|
|
|
@ -208,7 +208,7 @@ static inline uint8_t lookupChannelIndex(const uint16_t channel)
|
||||||
|
|
||||||
rccPeriphTag_t timerRCC(TIM_TypeDef *tim)
|
rccPeriphTag_t timerRCC(TIM_TypeDef *tim)
|
||||||
{
|
{
|
||||||
for (uint8_t i = 0; i < HARDWARE_TIMER_DEFINITION_COUNT; i++) {
|
for (int i = 0; i < HARDWARE_TIMER_DEFINITION_COUNT; i++) {
|
||||||
if (timerDefinitions[i].TIMx == tim) {
|
if (timerDefinitions[i].TIMx == tim) {
|
||||||
return timerDefinitions[i].rcc;
|
return timerDefinitions[i].rcc;
|
||||||
}
|
}
|
||||||
|
@ -787,12 +787,12 @@ void timerInit(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* enable the timer peripherals */
|
/* enable the timer peripherals */
|
||||||
for (uint8_t i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
||||||
RCC_ClockCmd(timerRCC(timerHardware[i].tim), ENABLE);
|
RCC_ClockCmd(timerRCC(timerHardware[i].tim), ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(STM32F3) || defined(STM32F4) || defined(STM32F7)
|
#if defined(STM32F3) || defined(STM32F4) || defined(STM32F7)
|
||||||
for (uint8_t timerIndex = 0; timerIndex < USABLE_TIMER_CHANNEL_COUNT; timerIndex++) {
|
for (int timerIndex = 0; timerIndex < USABLE_TIMER_CHANNEL_COUNT; timerIndex++) {
|
||||||
const timerHardware_t *timerHardwarePtr = &timerHardware[timerIndex];
|
const timerHardware_t *timerHardwarePtr = &timerHardware[timerIndex];
|
||||||
IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), IOCFG_AF_PP, timerHardwarePtr->alternateFunction);
|
IOConfigGPIOAF(IOGetByTag(timerHardwarePtr->tag), IOCFG_AF_PP, timerHardwarePtr->alternateFunction);
|
||||||
}
|
}
|
||||||
|
@ -858,7 +858,7 @@ void timerForceOverflow(TIM_TypeDef *tim)
|
||||||
|
|
||||||
const timerHardware_t *timerGetByTag(ioTag_t tag, timerUsageFlag_e flag)
|
const timerHardware_t *timerGetByTag(ioTag_t tag, timerUsageFlag_e flag)
|
||||||
{
|
{
|
||||||
for (uint8_t i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
for (int i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
|
||||||
if (timerHardware[i].tag == tag) {
|
if (timerHardware[i].tag == tag) {
|
||||||
if (timerHardware[i].output & flag) {
|
if (timerHardware[i].output & flag) {
|
||||||
return &timerHardware[i];
|
return &timerHardware[i];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue