Цитата(dimka76 @ Dec 14 2007, 14:33)

Вот фрагмент текста программы:
Код
__no_init UCHAR RxBuf[2][BUFSIZE] __attribute__ ((section (BUFFER_SECTION))) IAR_SECTION(BUFFER_SECTION);
UCHAR InputBuf;
UCHAR AppBuf;
-> InputBuf = (UCHAR)RxBuf[0];
-> AppBuf = (UCHAR)RxBuf[1];
и в указанных стрелкой строчках компилятор выдает следующие предупреждения
Код
Warning[Pe767]: conversion from pointer to smaller integer
Warning[Pe767]: conversion from pointer to smaller integer
Объясните, пожалуйста, что не так и как с этим бороться.
Компилятор, конечно, прав, но при следовании требованиям в usbdrv.h
Цитата
Limitations:
============
Compiling:
You should link the usbdrv.o module first because it has special alignment
requirements for the receive buffer (the buffer must not cross a 256 byte
page boundary, it must not even touch it at the end). If you can't link it
first, you must use other measures to ensure alignment.
Note: gcc does not always assign variable addresses in the order as the modules
are linked or the variables are declared. You can choose a memory section for
the receive buffer with the configuration option "USB_BUFFER_SECTION". This
option defaults to ".bss". If you use your own section, you can place it at
an arbitrary location with a linker option similar to
"-Wl,--section-start=.mybuffer=0x800060". Use "avr-nm -ng" on the binary and
search for "usbRxBuf" to find tbe base address of the 22 bytes rx buffer.
и в usbdrv.c
Цитата
/* usbRxBuf MUST be in 1 byte addressable range (because usbInputBuf is only 1 byte) */
на эти предупреждения можно забить.
Применительно к IAR требования удовлетворяются опцией линкера (Project->Options->Linker->Extra options)
-Z(DATA)USB_BUFFER_SECTION=0100-01FE
Цитата
К хелпу просьба не отсылать, с аглицким туго

К сожалению, вариантов немного.