Skip to content

Commit

Permalink
Update wiring.c
Browse files Browse the repository at this point in the history
  • Loading branch information
MX682X committed May 30, 2023
1 parent 20b3eca commit 28843d0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions megaavr/cores/megatinycore/wiring.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ uint8_t __PeripheralControl = 0xFF;
"push r31" "\n\t" //
:: [CLRFL] "M" (_timerS.intClear),
[PTCLR] "m" (*_timerS.intStatusReg));

#if (defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || defined(MILLIS_USE_TIMERB4))
__asm__ __volatile__(
"ld r24, Z" "\n\t" // Z points to LSB of timer_millis, load the LSB
Expand Down Expand Up @@ -246,7 +247,7 @@ uint8_t __PeripheralControl = 0xFF;
}
*/
#else // TCA0 or TCD0, also naked

/*
__asm__ __volatile__(
// ISR prologue (overall 10 words / 10 clocks (+ loading of Z)):
"push r25" "\n\t" // one extra Register needed
Expand Down Expand Up @@ -311,8 +312,8 @@ uint8_t __PeripheralControl = 0xFF;
[MIINC] "M" ((0x0000 - MILLIS_INC) & 0xFF),
[MINCD] "M" ((0xFFFF - MILLIS_INC) & 0xFF)
);

/*
*/

__asm__ __volatile__(
// ISR prologue (overall 10 words / 10 clocks (+ loading of Z)):
"push r25" "\n\t" // second byte
Expand Down Expand Up @@ -371,9 +372,9 @@ uint8_t __PeripheralControl = 0xFF;
[HFRMAX] "M" ((FRACT_MAX>>8 & 0xFF)),
[MIINC] "M" ((0x0000 - MILLIS_INC) & 0xFF),
[MINCD] "M" ((0xFFFF - MILLIS_INC) & 0xFF)
);*/
);
#endif /* (defined(MILLIS_USE_TIMERB0) || defined(MILLIS_USE_TIMERB1) || defined(MILLIS_USE_TIMERB2) || defined(MILLIS_USE_TIMERB3) || defined(MILLIS_USE_TIMERB4)) */
// ISR Epilogue
// Common ISR Epilogue for TCA, TCB and TCD, popping register in reverse Order
// 6 words, 14 clocks
__asm__ __volatile__(
"pop r31" "\n\t"
Expand Down

0 comments on commit 28843d0

Please sign in to comment.