Skip to content

Commit

Permalink
put a buncha stuff in flash
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyPork committed Sep 9, 2017
1 parent 13fa224 commit 3479ab3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <esp8266.h>
#include "base64.h"

static const int base64dec_tab[256] ICACHE_RODATA_ATTR={
static const int base64dec_tab[256] ESP_CONST_DATA = {
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255, 62,255,255,255, 63,
Expand Down
6 changes: 3 additions & 3 deletions core/httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Esp8266 http server - core routines
#include "httpd-platform.h"

//This gets set at init time.
static HttpdBuiltInUrl *builtInUrls;
static const HttpdBuiltInUrl *builtInUrls;

typedef struct HttpSendBacklogItem HttpSendBacklogItem;

Expand Down Expand Up @@ -62,7 +62,7 @@ typedef struct {

//The mappings from file extensions to mime types. If you need an extra mime type,
//add it here.
static const ICACHE_RODATA_ATTR MimeMap mimeTypes[]={
static const MimeMap mimeTypes[] ESP_CONST_DATA ={
{"htm", "text/html"},
{"html", "text/html"},
{"css", "text/css"},
Expand Down Expand Up @@ -1023,7 +1023,7 @@ int ICACHE_FLASH_ATTR httpdConnectCb(ConnTypePtr conn, char *remIp, int remPort)
}

//Httpd initialization routine. Call this to kick off webserver functionality.
void ICACHE_FLASH_ATTR httpdInit(HttpdBuiltInUrl *fixedUrls, int port) {
void ICACHE_FLASH_ATTR httpdInit(const HttpdBuiltInUrl *fixedUrls, int port) {
int i;

for (i=0; i<HTTPD_MAX_CONNECTIONS; i++) {
Expand Down
4 changes: 4 additions & 0 deletions include/esp8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@ static inline void my_free(void *p, int line, const char *fn) {
#define free(p) os_free(p)
#endif



#define ESP_CONST_DATA __attribute__((aligned(4))) __attribute__((section(".irom.text")))

#endif // ESP8266_COMMON_H
2 changes: 1 addition & 1 deletion include/espmissingincludes.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void ets_timer_disarm(os_timer_t *a);
void ets_timer_setfn(os_timer_t *t, ETSTimerFunc *fn, void *parg);
void ets_update_cpu_frequency(int freqmhz);
void *os_memmove(void *dest, const void *src, size_t n);
int os_printf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
//int os_printf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
int os_snprintf(char *str, size_t size, const char *format, ...) __attribute__ ((format (printf, 3, 4)));
int os_printf_plus(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
void uart_div_modify(int no, unsigned int freq);
Expand Down
2 changes: 1 addition & 1 deletion include/httpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ httpd_cgi_state cgiRedirectApClientToHostname(HttpdConnData *connData);
void httpdRedirect(HttpdConnData *conn, char *newUrl);
int httpdUrlDecode(char *val, int valLen, char *ret, int retLen);
int httpdFindArg(char *line, char *arg, char *buff, int buffLen);
void httpdInit(HttpdBuiltInUrl *fixedUrls, int port);
void httpdInit(const HttpdBuiltInUrl *fixedUrls, int port);
const char *httpdGetMimetype(const char *url);
const char *httpdMethodName(httpd_method m);
void httdSetTransferMode(HttpdConnData *conn, int mode);
Expand Down

0 comments on commit 3479ab3

Please sign in to comment.