arduino as a library will not build with -flto. I can't figure it out. so we waste some space compared to what platformio was building. oh well. there's still over 1K of space left for programs.
27 lines
642 B
C
27 lines
642 B
C
#if !defined(CORE_ATTACH_OLD) && !defined(CORE_ATTACH_ALL)
|
|
#include <inttypes.h>
|
|
#include <avr/io.h>
|
|
#include <avr/interrupt.h>
|
|
#include <avr/pgmspace.h>
|
|
#include <stdio.h>
|
|
#include "wiring_private.h"
|
|
#if defined(PORTC_PINS)
|
|
extern voidFuncPtr * intFunc[];
|
|
voidFuncPtr intFunc_C[PORTC_PINS];
|
|
void attachPortCEnable() {
|
|
intFunc[2] = intFunc_C;
|
|
}
|
|
ISR(PORTC_PORT_vect, ISR_NAKED) {
|
|
asm volatile(
|
|
"push r16" "\n\t"
|
|
"ldi r16, 4" "\n\t"
|
|
#if PROGMEM_SIZE > 8192
|
|
"jmp AttachedISR" "\n\t"
|
|
#else
|
|
"rjmp AttachedISR" "\n\t"
|
|
#endif
|
|
::);
|
|
}
|
|
#endif
|
|
#endif
|