Skip to content

Commit

Permalink
lol, let's try that again
Browse files Browse the repository at this point in the history
  • Loading branch information
joeycastillo committed Jul 15, 2024
1 parent 9023003 commit 336ed9a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions peripherals/tcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,11 @@ void tcc_set_output_matrix(uint8_t instance, tcc_output_matrix_t mode) {
}

void tcc_set_channel_polarity(uint8_t instance, uint8_t channel, tcc_channel_polarity_t polarity) {
uint8_t value = TCC_Peripherals[instance].tcc->DRVCTRL.reg;

if (polarity == TCC_CHANNEL_POLARITY_INVERTED) {
value |= TCC_DRVCTRL_INVEN((1 << channel));
TCC_Peripherals[instance].tcc->DRVCTRL.reg |= (1 << (channel + TCC_DRVCTRL_INVEN0_Pos));
} else {
value &= TCC_DRVCTRL_INVEN(~(1 << channel));
TCC_Peripherals[instance].tcc->DRVCTRL.reg &= ~(1 << (channel + TCC_DRVCTRL_INVEN0_Pos));
}

TCC_Peripherals[instance].tcc->DRVCTRL.reg = value;
}

void tcc_enable(uint8_t instance) {
Expand Down

0 comments on commit 336ed9a

Please sign in to comment.