прочитал AVR034.pdf и решил для начала попробовать их примерчики.
вот функция примера на asm пристегнутая к проекту
Код
NAME get_port
#include "io8515.h"; The #include file must be within the module
PUBLIC get_port_asm ; Declare symbols to be exported to C function
RSEG CODE ; This code is relocatable, RSEG
get_port_asm; ; Label, start execution here
in R16,PIND ; Read in the pind value
swap R16 ; Swap the upper and lower nibble
out PORTB,R16; Output the data to the port register
ret ; Return to the main function
END
#include "io8515.h"; The #include file must be within the module
PUBLIC get_port_asm ; Declare symbols to be exported to C function
RSEG CODE ; This code is relocatable, RSEG
get_port_asm; ; Label, start execution here
in R16,PIND ; Read in the pind value
swap R16 ; Swap the upper and lower nibble
out PORTB,R16; Output the data to the port register
ret ; Return to the main function
END
вот main.c
Код
#include "io8515.h"
//#pragma language = 0
extern void get_port_asm(void);/* Function prototype for asm function */
__task void main(void)
{
DDRD = 0x00;/* Initialization of the I/O ports*/
DDRB = 0xFF;
while(1)/* Infinite loop*/
{
get_port_asm();/* Call the assembler function */
}
}
//#pragma language = 0
extern void get_port_asm(void);/* Function prototype for asm function */
__task void main(void)
{
DDRD = 0x00;/* Initialization of the I/O ports*/
DDRB = 0xFF;
while(1)/* Infinite loop*/
{
get_port_asm();/* Call the assembler function */
}
}
а вот ошибка
Код
Error[e46]: Undefined external "get_port_asm()" referred in main
Если выбрать С то все работает, но в документации написано что asm для С и Embedded C++ существует.
Может как0то по другому надо описать, или Header какой подключить, или еще что .... ?