Skip to content

Commit

Permalink
Update wiring_analog.c to remove leftover debug code
Browse files Browse the repository at this point in the history
This was scribbling over GPIOR registers contrary to documented behavior. #532  part 1
  • Loading branch information
SpenceKonde authored Aug 15, 2024
1 parent 9e2a3f8 commit b400368
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions megaavr/cores/dxcore/wiring_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,14 +970,11 @@ void analogWrite(uint8_t pin, int val) {
// Write the value to the register.
*(((volatile uint8_t*) &(timer_A->SPLIT.LCMP0)) + offset) = val;
// and ctrlb to ctrlb
GPIOR2 = ctrlb;
uint8_t t = timer_A->SPLIT.CTRLB;
uint8_t oldsreg = SREG;
cli();
t |= ctrlb;
GPIOR3 = t;
timer_A->SPLIT.CTRLB = ctrlb;
GPIOR1 = timer_A->SPLIT.CTRLB;
SREG = oldsreg;
/* Okay, this layout tends towards maximum pervosity. You basically have to treat them as entirely separate timers at this point!
* PORT | DA | DB | DD | EA | portnum
Expand Down

0 comments on commit b400368

Please sign in to comment.