000000widow-hackspacecon/fw/HackSpaceCon_AS7/Arduino/megatinycore/WInterrupts_PC.c
true 70b9fe0dd6 migrate code to AS7, including fucked up arduino import
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.
2025-04-23 01:42:39 -07:00

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