diff --git a/cpu/avr/Makefile.avr b/cpu/avr/Makefile.avr index 7ca45bf05..73c662582 100644 --- a/cpu/avr/Makefile.avr +++ b/cpu/avr/Makefile.avr @@ -139,10 +139,10 @@ ifndef NOAVRSIZE avr-size -C --mcu=$(MCU) $@ endif -%.hex: %.out +%.hex: %.$(TARGET) $(OBJCOPY) $^ -j .text -j .data -O ihex $@ -%.ihex: %.out +%.ihex: %.$(TARGET) $(OBJCOPY) $^ -O ihex $@ # Add a namelist to the kernel @@ -160,7 +160,7 @@ endif #%.hex: %.elf # $(OBJCOPY) -R .eeprom -R .fuse -R .signature $^ -O ihex $@ -%.eep: %.out +%.eep: %.$(TARGET) -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ --change-section-lma .eeprom=0 -O ihex $^ $@ diff --git a/platform/avr-raven/apps/raven-webserver/httpd-cgi.c b/platform/avr-raven/apps/raven-webserver/httpd-cgi.c index f085991bf..874ad4246 100644 --- a/platform/avr-raven/apps/raven-webserver/httpd-cgi.c +++ b/platform/avr-raven/apps/raven-webserver/httpd-cgi.c @@ -368,7 +368,7 @@ make_routes(void *p) j++; numprinted += httpd_cgi_sprint_ip6(r->ipaddr, uip_appdata + numprinted); numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_rtes1, r->length); - numprinted += httpd_cgi_sprint_ip6(uip_ds6_route_nexthop(r), uip_appdata + numprinted); + numprinted += httpd_cgi_sprint_ip6(*uip_ds6_route_nexthop(r), uip_appdata + numprinted); if(r->state.lifetime < 3600) { numprinted += httpd_snprintf((char *)uip_appdata+numprinted, uip_mss()-numprinted, httpd_cgi_rtes2, r->state.lifetime); } else { diff --git a/platform/avr-raven/contiki-conf.h b/platform/avr-raven/contiki-conf.h index 2fe0d6099..ead35168b 100644 --- a/platform/avr-raven/contiki-conf.h +++ b/platform/avr-raven/contiki-conf.h @@ -162,6 +162,7 @@ typedef unsigned short uip_stats_t; #define UIP_CONF_ICMP6 1 #define UIP_CONF_UDP 1 #define UIP_CONF_TCP 1 +#define UIP_CONF_BUFFER_SIZE 1300 #define NETSTACK_CONF_NETWORK sicslowpan_driver #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06 #else diff --git a/platform/avr-ravenlcd/Makefile b/platform/avr-ravenlcd/Makefile index e16132765..fef0167d9 100644 --- a/platform/avr-ravenlcd/Makefile +++ b/platform/avr-ravenlcd/Makefile @@ -28,7 +28,7 @@ LDFLAGS = $(COMMON) LDFLAGS += -Wl,-Map=$(PROJECT).map,--cref ## Intel Hex file production flags -HEX_FLASH_FLAGS = -R .eeprom +HEX_FLASH_FLAGS = -j .text -j .data HEX_EEPROM_FLAGS = -j .eeprom HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load" diff --git a/platform/avr-ravenlcd/beep.c b/platform/avr-ravenlcd/beep.c index 34f2ee23f..cb2a0510b 100644 --- a/platform/avr-ravenlcd/beep.c +++ b/platform/avr-ravenlcd/beep.c @@ -132,11 +132,11 @@ beep(void) static uint8_t tuneindex=0; -static uint8_t pictures[] PROGMEM = {G4,4, F4,4, AS4,4, C5,2, F5,2, D5,4, C5,2, F5,2, D5,4, AS4,4, C5,4, G4,4, F4,4, 0xff}; -static uint8_t axel[] PROGMEM = {FS4,2, NONE,2, A4,3, FS4,2, FS4,1, B4,2, FS4,2, E4,2, FS4,2, NONE,2, CS5,3, FS4,2, FS4,1, D5,2, CS5,2, A4,2, FS4,2, CS5,2, FS5,2, FS4,1, E4,2, E4,1, CS4,2, GS4,2, FS4,6, 0xff}; -static uint8_t sandman1[] PROGMEM = {F4,2, G4,2, B4,4, A4,10, B4,2, B4,2, A4,2, B4,12, 0xff}; -static uint8_t sandman2[] PROGMEM = {C4,2, E4,2, G4,2, B4,2, A4,2, G4,2, E4,2, C4,2, D4,2, F4,2, A4,2, C5,2, B4,8, 0xff}; -static uint8_t furelise[] PROGMEM = {E5,1, DS5,1, E5,1, DS5,1, E5,1, B4,1, D5,1, E5,1, A4,2, NONE,1, C4,1, E4,1, A4,1, B4,2, NONE,1, E4,1, GS4,1, B4,1, C5,2, 0xff}; +static const uint8_t pictures[] PROGMEM = {G4,4, F4,4, AS4,4, C5,2, F5,2, D5,4, C5,2, F5,2, D5,4, AS4,4, C5,4, G4,4, F4,4, 0xff}; +static const uint8_t axel[] PROGMEM = {FS4,2, NONE,2, A4,3, FS4,2, FS4,1, B4,2, FS4,2, E4,2, FS4,2, NONE,2, CS5,3, FS4,2, FS4,1, D5,2, CS5,2, A4,2, FS4,2, CS5,2, FS5,2, FS4,1, E4,2, E4,1, CS4,2, GS4,2, FS4,6, 0xff}; +static const uint8_t sandman1[] PROGMEM = {F4,2, G4,2, B4,4, A4,10, B4,2, B4,2, A4,2, B4,12, 0xff}; +static const uint8_t sandman2[] PROGMEM = {C4,2, E4,2, G4,2, B4,2, A4,2, G4,2, E4,2, C4,2, D4,2, F4,2, A4,2, C5,2, B4,8, 0xff}; +static const uint8_t furelise[] PROGMEM = {E5,1, DS5,1, E5,1, DS5,1, E5,1, B4,1, D5,1, E5,1, A4,2, NONE,1, C4,1, E4,1, A4,1, B4,2, NONE,1, E4,1, GS4,1, B4,1, C5,2, 0xff}; static volatile uint8_t icnt,tone; @@ -153,7 +153,8 @@ ISR(TIMER0_OVF_vect) void play_ringtone(void) { -uint8_t i,*noteptr; +uint8_t i; +const uint8_t *noteptr; /* What's next on the playlist? */ switch (tuneindex++) { diff --git a/platform/avr-ravenlcd/lcd.c b/platform/avr-ravenlcd/lcd.c index 3c4f9e230..0fe92b80a 100644 --- a/platform/avr-ravenlcd/lcd.c +++ b/platform/avr-ravenlcd/lcd.c @@ -411,7 +411,7 @@ lcd_num_putdec(int numb, lcd_padding_t padding) } /* Convert to BCD */ - bcd = itobcd(ABS(numb)); + bcd = itobcd(abs(numb)); /* Print */ return lcd_num_print(bcd, (bool)(numb<0), padding); diff --git a/platform/avr-ravenlcd/menu.c b/platform/avr-ravenlcd/menu.c index a5cda40a9..3069d7825 100644 --- a/platform/avr-ravenlcd/menu.c +++ b/platform/avr-ravenlcd/menu.c @@ -66,6 +66,27 @@ bool auto_temp=true; /*---------------------------------------------------------------------------*/ +/** + * \brief This will reliably set or clear the JTD bit of the MCUCR register. + * + * \param x True to set the JTD bit disabling JTAG. +*/ +#define jtd_set(x)\ +{\ + __asm__ __volatile__ (\ + "in __tmp_reg__,__SREG__" "\n\t"\ + "cli" "\n\t"\ + "out %1, %0" "\n\t"\ + "out __SREG__, __tmp_reg__" "\n\t"\ + "out %1, %0" "\n\t"\ + : /* no outputs */\ + : "r" ((uint8_t)(x ? (1<