PROGMEM changes needed for newer avr-gcc compiler

This commit is contained in:
David Kopf 2012-02-21 11:10:57 -05:00
parent 5fdcd6bc13
commit 6e45dfe5ff
14 changed files with 51 additions and 70 deletions

View file

@ -146,13 +146,13 @@ PT_THREAD(send_string_P(struct httpd_state *s, char *str))
}
#endif
/*---------------------------------------------------------------------------*/
char http_content_type_html[] PROGMEM = "Content-type: text/html\r\n\r\n";
const char http_content_type_html[] PROGMEM = "Content-type: text/html\r\n\r\n";
static
PT_THREAD(send_headers(struct httpd_state *s, char *statushdr))
PT_THREAD(send_headers(struct httpd_state *s, const char *statushdr))
{
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, statushdr);
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, http_content_type_html);
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) statushdr);
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) http_content_type_html);
PSOCK_END(&s->sout);
}
/*---------------------------------------------------------------------------*/
@ -241,9 +241,9 @@ ipaddr_add(const uip_ipaddr_t *addr)
}
}
/*---------------------------------------------------------------------------*/
char TOP1[] PROGMEM = "<html><head><title>ContikiRPL(Jackdaw)";
char TOP2[] PROGMEM = "</title></head><body>";
char BOTTOM[] PROGMEM = "</body></html>";
const char TOP1[] PROGMEM = "<html><head><title>ContikiRPL(Jackdaw)";
const char TOP2[] PROGMEM = "</title></head><body>";
const char BOTTOM[] PROGMEM = "</body></html>";
#if UIP_CONF_IPV6
extern uip_ds6_nbr_t uip_ds6_nbr_cache[];
extern uip_ds6_route_t uip_ds6_routing_table[];
@ -255,8 +255,8 @@ PT_THREAD(generate_routes(struct httpd_state *s))
uint8_t i=0;
PSOCK_BEGIN(&s->sout);
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, TOP1);
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, TOP2);
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) TOP1);
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) TOP2);
#if UIP_CONF_IPV6 //allow ip4 builds
blen = 0;
@ -305,7 +305,7 @@ PT_THREAD(generate_routes(struct httpd_state *s))
PSOCK_GENERATOR_SEND(&s->sout, generate_string, buf);
#endif /* UIP_CONF_IPV6 */
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, BOTTOM);
PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, (char *) BOTTOM);
PSOCK_END(&s->sout);
}
@ -317,9 +317,9 @@ httpd_simple_get_script(const char *name)
return generate_routes;
}
/*---------------------------------------------------------------------------*/
char http_header_200[] PROGMEM = "HTTP/1.0 200 OK\r\nServer: Jackdaw\r\nConnection: close\r\n";
char http_header_404[] PROGMEM = "HTTP/1.0 404 Not found\r\nServer: Jackdaw\r\nConnection: close\r\n";
char NOT_FOUND[] PROGMEM = "<html><body bgcolor=\"white\"><center><h1>404 - file not found</h1></center></body></html>";
const char http_header_200[] PROGMEM = "HTTP/1.0 200 OK\r\nServer: Jackdaw\r\nConnection: close\r\n";
const char http_header_404[] PROGMEM = "HTTP/1.0 404 Not found\r\nServer: Jackdaw\r\nConnection: close\r\n";
const char NOT_FOUND[] PROGMEM = "<html><body bgcolor=\"white\"><center><h1>404 - file not found</h1></center></body></html>";
static
PT_THREAD(handle_output(struct httpd_state *s))
{