From 75e9deb9e9693a5901cf0c9a4cdcc431a32e97b4 Mon Sep 17 00:00:00 2001 From: Georg von Zengen Date: Thu, 3 May 2012 10:11:36 +0200 Subject: [PATCH] enabled __PROG_TYPES_COMPAT__ flag and added const for PROGMEM variables to be compatible with avr-libc-1.8 and gcc-4.7 binutils-2.22.52 --- cpu/avr/Makefile.avr | 2 +- platform/inga/contiki-inga-main.c | 32 +++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cpu/avr/Makefile.avr b/cpu/avr/Makefile.avr index e7df5b57ec4..e56f5483f32 100644 --- a/cpu/avr/Makefile.avr +++ b/cpu/avr/Makefile.avr @@ -114,7 +114,7 @@ CFLAGSNO = -Wall -mmcu=$(MCU) -gdwarf-2 -fno-strict-aliasing \ -I. -I$(CONTIKI)/core -I$(CONTIKI_CPU) $(USB_INCLUDES) \ -I$(CONTIKI)/platform/$(TARGET) \ $(CONTIKI_PLAT_DEFS) -CFLAGS += $(CFLAGSNO) -O$(OPTI) +CFLAGS += $(CFLAGSNO) -O$(OPTI) -D__PROG_TYPES_COMPAT__ ifndef BOOTLOADER_START BOOTLOADER_START = 0x1F800 endif diff --git a/platform/inga/contiki-inga-main.c b/platform/inga/contiki-inga-main.c index 7ca82d5b028..09c9813c95b 100644 --- a/platform/inga/contiki-inga-main.c +++ b/platform/inga/contiki-inga-main.c @@ -156,46 +156,46 @@ extern uint8_t default_server_name[16]; extern uint8_t default_domain_name[30]; #else #ifdef MAC_ADDRESS -uint8_t default_mac_address[8] PROGMEM = MAC_ADDRESS; +const uint8_t default_mac_address[8] PROGMEM = MAC_ADDRESS; #else -uint8_t default_mac_address[8] PROGMEM = {0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x55}; +const uint8_t default_mac_address[8] PROGMEM = {0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x55}; #endif #ifdef SERVER_NAME -uint8_t default_server_name[16] PROGMEM = SERVER_NAME; +const uint8_t default_server_name[16] PROGMEM = SERVER_NAME; #else -uint8_t default_server_name[16] PROGMEM = "Raven_webserver"; +const uint8_t default_server_name[16] PROGMEM = "Raven_webserver"; #endif #ifdef DOMAIN_NAME -uint8_t default_domain_name[30] PROGMEM = DOMAIN_NAME +const uint8_t default_domain_name[30] PROGMEM = DOMAIN_NAME #else -uint8_t default_domain_name[30] PROGMEM = "localhost"; +const uint8_t default_domain_name[30] PROGMEM = "localhost"; #endif #endif /* AVR_WEBSERVER */ #ifdef NODE_ID -uint16_t default_nodeid PROGMEM = NODEID; +const uint16_t default_nodeid PROGMEM = NODEID; #else -uint16_t default_nodeid PROGMEM = 0; +const uint16_t default_nodeid PROGMEM = 0; #endif #ifdef CHANNEL_802_15_4 -uint8_t default_channel PROGMEM = CHANNEL_802_15_4; +const uint8_t default_channel PROGMEM = CHANNEL_802_15_4; #else -uint8_t default_channel PROGMEM = 26; +const uint8_t default_channel PROGMEM = 26; #endif #ifdef IEEE802154_PANID -uint16_t default_panid PROGMEM = IEEE802154_PANID; +const uint16_t default_panid PROGMEM = IEEE802154_PANID; #else -uint16_t default_panid PROGMEM = 0xABCD; +const uint16_t default_panid PROGMEM = 0xABCD; #endif #ifdef IEEE802154_PANADDR -uint16_t default_panaddr PROGMEM = IEEE802154_PANID; +const uint16_t default_panaddr PROGMEM = IEEE802154_PANID; #else -uint16_t default_panaddr PROGMEM = 0; +const uint16_t default_panaddr PROGMEM = 0; #endif #ifdef RF230_MAX_TX_POWER -uint8_t default_txpower PROGMEM = RF230_MAX_TX_POWER; +const uint8_t default_txpower PROGMEM = RF230_MAX_TX_POWER; #else -uint8_t default_txpower PROGMEM = 0; +const uint8_t default_txpower PROGMEM = 0; #endif /* Get a pseudo random number using the ADC */