mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
Added 'timer show' command to CLI.
This commit is contained in:
parent
025ff572b6
commit
6a0c5836de
16 changed files with 217 additions and 125 deletions
|
@ -257,10 +257,8 @@ const int8_t timerNumbers[USED_TIMER_COUNT] = {
|
|||
#undef _DEF
|
||||
};
|
||||
|
||||
int8_t timerGetTIMNumber(const TIM_TypeDef *tim)
|
||||
int8_t timerGetNumberByIndex(uint8_t index)
|
||||
{
|
||||
uint8_t index = lookupTimerIndex(tim);
|
||||
|
||||
if (index < USED_TIMER_COUNT) {
|
||||
return timerNumbers[index];
|
||||
} else {
|
||||
|
@ -268,6 +266,13 @@ int8_t timerGetTIMNumber(const TIM_TypeDef *tim)
|
|||
}
|
||||
}
|
||||
|
||||
int8_t timerGetTIMNumber(const TIM_TypeDef *tim)
|
||||
{
|
||||
const uint8_t index = lookupTimerIndex(tim);
|
||||
|
||||
return timerGetNumberByIndex(index);
|
||||
}
|
||||
|
||||
static inline uint8_t lookupChannelIndex(const uint16_t channel)
|
||||
{
|
||||
return channel >> 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue