Using one header file for esp8266 stuff

pull/30/head
Jindra Dolezy 10 years ago
parent a1b8b82816
commit d419bdb4f7
  1. 7
      espfs/espfs.c
  2. 8
      espfs/heatshrink_decoder.c
  3. 10
      httpd/auth.c
  4. 2
      httpd/auth.h
  5. 6
      httpd/base64.c
  6. 8
      httpd/httpd.c
  7. 3
      httpd/httpd.h
  8. 10
      httpd/httpdespfs.c
  9. 1
      httpd/httpdespfs.h
  10. 18
      include/esp8266.h
  11. 8
      user/cgi.c
  12. 9
      user/cgiflash.c
  13. 10
      user/cgiwifi.c
  14. 14
      user/io.c
  15. 5
      user/stdout.c
  16. 4
      user/user_main.c

@ -20,12 +20,7 @@ It's written for use with httpd, but doesn't need to be used as such.
#ifdef __ets__ #ifdef __ets__
//esp build //esp build
#include "c_types.h" #include <esp8266.h>
#include "user_interface.h"
#include "espconn.h"
#include "mem.h"
#include "osapi.h"
#include "espmissingincludes.h"
#else #else
//Test build //Test build
#include <stdio.h> #include <stdio.h>

@ -5,14 +5,8 @@
#ifdef __ets__ #ifdef __ets__
//esp build //esp build
#define _STDLIB_H_
#define _STRING_H_
#define _STDDEF_H
#include "espmissingincludes.h" #include <esp8266.h>
#include "c_types.h"
#include "mem.h"
#include "osapi.h"
#define memset(x,y,z) os_memset(x,y,z) #define memset(x,y,z) os_memset(x,y,z)
#define memcpy(x,y,z) os_memcpy(x,y,z) #define memcpy(x,y,z) os_memcpy(x,y,z)

@ -12,17 +12,9 @@ HTTP auth implementation. Only does basic authentication for now.
*/ */
#include <string.h> #include <esp8266.h>
#include <osapi.h>
#include "user_interface.h"
#include "mem.h"
#include "httpd.h"
#include "cgi.h"
#include "auth.h" #include "auth.h"
#include "io.h"
#include "base64.h" #include "base64.h"
#include <ip_addr.h>
#include "espmissingincludes.h"
int ICACHE_FLASH_ATTR authBasic(HttpdConnData *connData) { int ICACHE_FLASH_ATTR authBasic(HttpdConnData *connData) {
const char *forbidden="401 Forbidden."; const char *forbidden="401 Forbidden.";

@ -1,6 +1,8 @@
#ifndef AUTH_H #ifndef AUTH_H
#define AUTH_H #define AUTH_H
#include "httpd.h"
#ifndef HTTP_AUTH_REALM #ifndef HTTP_AUTH_REALM
#define HTTP_AUTH_REALM "Protected" #define HTTP_AUTH_REALM "Protected"
#endif #endif

@ -1,10 +1,6 @@
/* base64.c : base-64 / MIME encode/decode */ /* base64.c : base-64 / MIME encode/decode */
/* PUBLIC DOMAIN - Jon Mayo - November 13, 2003 */ /* PUBLIC DOMAIN - Jon Mayo - November 13, 2003 */
#include "c_types.h" #include <esp8266.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <ctype.h>
#include "base64.h" #include "base64.h"
static const uint8_t base64dec_tab[256]= { static const uint8_t base64dec_tab[256]= {

@ -12,13 +12,7 @@ Esp8266 http server - core routines
*/ */
#include "espmissingincludes.h" #include <esp8266.h>
#include "c_types.h"
#include "user_interface.h"
#include "espconn.h"
#include "mem.h"
#include "osapi.h"
#include "httpd.h" #include "httpd.h"

@ -1,8 +1,5 @@
#ifndef HTTPD_H #ifndef HTTPD_H
#define HTTPD_H #define HTTPD_H
#include <c_types.h>
#include <ip_addr.h>
#include <espconn.h>
#define HTTPDVER "0.3" #define HTTPDVER "0.3"

@ -11,15 +11,9 @@ Connector to let httpd use the espfs filesystem to serve the files in it.
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
#include "espmissingincludes.h" #include <esp8266.h>
#include <string.h>
#include <osapi.h>
#include "c_types.h"
#include "user_interface.h"
#include "espconn.h"
#include "mem.h"
#include "httpdespfs.h" #include "httpdespfs.h"
#include "espfs.h"
//This is a catch-all cgi function. It takes the url passed to it, looks up the corresponding //This is a catch-all cgi function. It takes the url passed to it, looks up the corresponding

@ -2,7 +2,6 @@
#define HTTPDESPFS_H #define HTTPDESPFS_H
#include "httpd.h" #include "httpd.h"
#include "espfs.h"
int cgiEspFsHook(HttpdConnData *connData); int cgiEspFsHook(HttpdConnData *connData);
int ICACHE_FLASH_ATTR cgiEspFsTemplate(HttpdConnData *connData); int ICACHE_FLASH_ATTR cgiEspFsTemplate(HttpdConnData *connData);

@ -0,0 +1,18 @@
// Combined include file for esp8266
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <c_types.h>
#include <ip_addr.h>
#include <espconn.h>
#include <ets_sys.h>
#include <gpio.h>
#include <mem.h>
#include <osapi.h>
#include <user_interface.h>
#include "espmissingincludes.h"
#include "uart_hw.h"

@ -13,15 +13,9 @@ flash as a binary. Also handles the hit counter on the main page.
*/ */
#include <string.h> #include <esp8266.h>
#include <osapi.h>
#include "user_interface.h"
#include "mem.h"
#include "httpd.h"
#include "cgi.h" #include "cgi.h"
#include "io.h" #include "io.h"
#include <ip_addr.h>
#include "espmissingincludes.h"
//cause I can't be bothered to write an ioGetLed() //cause I can't be bothered to write an ioGetLed()

@ -12,15 +12,8 @@ Some flash handling cgi routines. Used for reading the existing flash and updati
*/ */
#include <string.h> #include <esp8266.h>
#include <osapi.h>
#include "user_interface.h"
#include "mem.h"
#include "httpd.h"
#include "cgiflash.h" #include "cgiflash.h"
#include "io.h"
#include <ip_addr.h>
#include "espmissingincludes.h"
#include "espfs.h" #include "espfs.h"

@ -12,14 +12,8 @@ Cgi/template routines for the /wifi url.
*/ */
#include <string.h> #include <esp8266.h>
#include <osapi.h> #include "cgiwifi.h"
#include "user_interface.h"
#include "mem.h"
#include "httpd.h"
#include "cgi.h"
#include "io.h"
#include "espmissingincludes.h"
//Enable this to disallow any changes in AP settings //Enable this to disallow any changes in AP settings
//#define DEMO_MODE //#define DEMO_MODE

@ -9,13 +9,7 @@
*/ */
#include "c_types.h" #include <esp8266.h>
#include "user_interface.h"
#include "espconn.h"
#include "mem.h"
#include "osapi.h"
#include "gpio.h"
#include "espmissingincludes.h"
#define LEDGPIO 2 #define LEDGPIO 2
#define BTNGPIO 0 #define BTNGPIO 0
@ -37,10 +31,10 @@ static void ICACHE_FLASH_ATTR resetBtnTimerCb(void *arg) {
resetCnt++; resetCnt++;
} else { } else {
if (resetCnt>=6) { //3 sec pressed if (resetCnt>=6) { //3 sec pressed
wifi_station_disconnect(); //wifi_station_disconnect();
wifi_set_opmode(0x3); //reset to AP+STA mode //wifi_set_opmode(0x3); //reset to AP+STA mode
os_printf("Reset to AP mode. Restarting system...\n"); os_printf("Reset to AP mode. Restarting system...\n");
system_restart(); //system_restart();
} }
resetCnt=0; resetCnt=0;
} }

@ -10,10 +10,7 @@
*/ */
#include "espmissingincludes.h" #include <esp8266.h>
#include "ets_sys.h"
#include "osapi.h"
#include "uart_hw.h"
static void ICACHE_FLASH_ATTR stdoutUartTxd(char c) { static void ICACHE_FLASH_ATTR stdoutUartTxd(char c) {
//Wait until there is room in the FIFO //Wait until there is room in the FIFO

@ -10,9 +10,7 @@
*/ */
#include "espmissingincludes.h" #include <esp8266.h>
#include "ets_sys.h"
#include "osapi.h"
#include "httpd.h" #include "httpd.h"
#include "io.h" #include "io.h"
#include "httpdespfs.h" #include "httpdespfs.h"

Loading…
Cancel
Save