[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [bug #54652] Missing support for ATmega328PB
From: |
Paulo Marques |
Subject: |
Re: [avr-libc-dev] [bug #54652] Missing support for ATmega328PB |
Date: |
Thu, 6 Jun 2019 14:07:16 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
Hi all,
I had to support the ATmega328PB in a personal project, and did with a
hack. I'm posting it here in case it helps anyone. I just created a
"hack.S" file with:
.macro vector name
.weak \name
.set \name, __my_bad_interrupt
jmp \name
.endm
.section .vectors,"ax",@progbits
.global __extra_vectors
.func __extra_vectors
__extra_vectors:
vector __vector_26
vector __vector_27
vector __vector_28
vector __vector_29
vector __vector_30
vector __vector_31
vector __vector_32
vector __vector_33
vector __vector_34
vector __vector_35
vector __vector_36
vector __vector_37
vector __vector_38
vector __vector_39
vector __vector_40
vector __vector_41
vector __vector_42
vector __vector_43
vector __vector_44
vector __vector_45
.endfunc
.text
.global __my_bad_interrupt
.func __my_bad_interrupt
__my_bad_interrupt:
jmp __bad_interrupt
.endfunc
Then to use the serial port 1 RX interrupt (for instance), just write on
the C code:
// serial port 1 rx data available
ISR(_VECTOR(28))
{
//.... code goes here
}
and I just compile as if it were 328P.
It is certainly a ugly hack, but it stays limited to your project,
without having to make changes to the toolchain.
Regards,
On 05/06/19 16:49, Paul Evans wrote:
Follow-up Comment #2, bug #54652 (project avr-libc):
Any update on this? I'm keen to not have to regularly make that 2-line edit to
my "io.h" file every time the debian package gets updated.
Is there a process by which this can make its way into a release?
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/bugs/?54652>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/
_______________________________________________
AVR-libc-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
--
Paulo Marques - www.grupopie.com
"To know recursion, you must first know recursion."