From: Michel Pollet Date: Mon, 28 May 2012 09:19:11 +0000 (+0100) Subject: usb: Fix for new compiler X-Git-Tag: v1.0~112 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=90de5703f0722c022d854f9df596a4c0a4c2cc54;p=sx%2Fsimavr.git usb: Fix for new compiler Progmem now need 'const'. Also fixed the makefile Signed-off-by: Michel Pollet --- diff --git a/examples/board_usb/Makefile b/examples/board_usb/Makefile index 9aa7f47..f7f668e 100644 --- a/examples/board_usb/Makefile +++ b/examples/board_usb/Makefile @@ -45,7 +45,7 @@ ${board} : ${OBJ}/${target}.o ../vhci/lib/libusb_vhci.a: @echo -n "BUILDIN $@ " - @{ $(MAKE) -j -C ../vhci >/tmp/vhci.build.log 2>&1 || \ + @{ export CC=;export CFLAGS=; $(MAKE) -j -C ../vhci >/tmp/vhci.build.log 2>&1 || \ { echo "ERROR check /tmp/vhci.build.log"; exit 1; }; } && \ echo " Done" diff --git a/examples/board_usb/at90usb162_cdc_loopback.c b/examples/board_usb/at90usb162_cdc_loopback.c index ae6dc40..738522f 100644 --- a/examples/board_usb/at90usb162_cdc_loopback.c +++ b/examples/board_usb/at90usb162_cdc_loopback.c @@ -147,7 +147,7 @@ static const uint8_t PROGMEM endpoint_config_table[] = { // in here should only be done by those who've read chapter 9 of the USB // spec and relevant portions of any USB class specifications! -static uint8_t PROGMEM device_descriptor[] = { +static const uint8_t PROGMEM device_descriptor[] = { 18, // bLength 1, // bDescriptorType 0x00, 0x02, // bcdUSB @@ -165,7 +165,7 @@ static uint8_t PROGMEM device_descriptor[] = { }; #define CONFIG1_DESC_SIZE (9+9+5+5+4+5+7+9+7+7) -static uint8_t PROGMEM config1_descriptor[CONFIG1_DESC_SIZE] = { +static const uint8_t PROGMEM config1_descriptor[CONFIG1_DESC_SIZE] = { // configuration descriptor, USB spec 9.6.3, page 264-266, Table 9-10 9, // bLength; 2, // bDescriptorType; @@ -249,22 +249,22 @@ struct usb_string_descriptor_struct { uint8_t bDescriptorType; int16_t wString[]; }; -static struct usb_string_descriptor_struct PROGMEM string0 = { +static const struct usb_string_descriptor_struct PROGMEM string0 = { 4, 3, {0x0409} }; -static struct usb_string_descriptor_struct PROGMEM string1 = { +static const struct usb_string_descriptor_struct PROGMEM string1 = { sizeof(STR_MANUFACTURER), 3, STR_MANUFACTURER }; -static struct usb_string_descriptor_struct PROGMEM string2 = { +static const struct usb_string_descriptor_struct PROGMEM string2 = { sizeof(STR_PRODUCT), 3, STR_PRODUCT }; -static struct usb_string_descriptor_struct PROGMEM string3 = { +static const struct usb_string_descriptor_struct PROGMEM string3 = { sizeof(STR_SERIAL_NUMBER), 3, STR_SERIAL_NUMBER @@ -272,7 +272,7 @@ static struct usb_string_descriptor_struct PROGMEM string3 = { // This table defines which descriptor data is sent for each specific // request from the host (in wValue and wIndex). -static struct descriptor_list_struct { +static const struct descriptor_list_struct { uint16_t wValue; uint16_t wIndex; const uint8_t *addr; diff --git a/examples/board_usb/simusb.c b/examples/board_usb/simusb.c index e779890..0bd079c 100644 --- a/examples/board_usb/simusb.c +++ b/examples/board_usb/simusb.c @@ -85,7 +85,7 @@ void avr_special_deinit( avr_t* avr) int main(int argc, char *argv[]) { - elf_firmware_t f; +// elf_firmware_t f; const char * pwd = dirname(argv[0]); avr = avr_make_mcu_by_name("at90usb162");