Skip to content

Commit

Permalink
add setter for rcr register
Browse files Browse the repository at this point in the history
  • Loading branch information
victorandrehc committed Mar 15, 2023
1 parent a38feca commit 8f34911
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 15 additions & 0 deletions src/modm/platform/timer/stm32/advanced.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,21 @@ public:
TIM{{ id }}->BDTR = flags;
}

/**
* sets the repetition count
* @param value to be set in the repetition count register
*/
static inline void
setRepetitionCount(uint8_t value)
{
uint8_t rcr = value;
if(rcr!=0)
{
rcr--;
}
TIM{{ id }}->RCR = rcr;
}

public:
static void
configureInputChannel(uint32_t channel, uint8_t filter);
Expand Down
3 changes: 0 additions & 3 deletions src/modm/platform/timer/stm32/advanced_base.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public:
//configureOutputChannel(uint32_t channel, OutputCompareMode mode,
// uint16_t compareValue);

// TODO Repetition Counter (TIM1_RCR)


enum class MasterMode : uint32_t
{
Reset = 0, // 0b000
Expand Down

0 comments on commit 8f34911

Please sign in to comment.