Good bye osdep.h, you won't be missed

PUBLISHED_FROM=f08a8324dfde5f9e22eee0e5e4dbae0e3d45cb3f
This commit is contained in:
rojer
2016-02-13 13:59:16 +00:00
parent 51ad50a641
commit 00a23ee330
6 changed files with 433 additions and 157 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ LINKFLAGS_eagle.app.v6 = \
-u call_user_start \
-Wl,-static \
-Wl,--start-group \
-lcirom \
-lc \
-lgcc \
-lhal \
-lphy \
+6 -3
View File
@@ -23,11 +23,14 @@ endif
# makefile at its root level - these are then overridden
# for a subtree within the makefile rooted therein
#
DEFINES += -DMG_DISABLE_DAV -DMG_DISABLE_SYNC_RESOLVER -DMG_DISABLE_CGI \
-DMG_DISABLE_SOCKETPAIR -DMG_DISABLE_DIRECTORY_LISTING \
DEFINES += -DMG_LOCALS \
-DMG_NO_BSD_SOCKETS \
-DMG_DISABLE_FILESYSTEM \
-DMG_DISABLE_STDIO \
-DMG_MAX_HTTP_HEADERS=20 -DMG_MAX_HTTP_REQUEST_SIZE=1024 \
-DMG_MAX_PATH=40 -DMG_MAX_HTTP_SEND_IOBUF=1024 \
-DMG_ESP8266 -DRTOS_SDK -DMG_LWIP
-DRTOS_SDK -DMG_LWIP -DLWIP_TIMEVAL_PRIVATE=0 \
-DMG_INTERNAL=
#############################################################
# Recursion Magic - Don't touch this!!
+6 -1
View File
@@ -16,6 +16,7 @@
#include "esp_common.h"
/* Makes fprintf(stdout) and stderr work. */
/*
_ssize_t _write_r(struct _reent *r, int fd, void *buf, size_t len) {
if (fd == 1 || fd == 2) {
size_t i;
@@ -26,6 +27,7 @@ _ssize_t _write_r(struct _reent *r, int fd, void *buf, size_t len) {
}
return -1;
}
*/
/*
* You'll need to implement _open_r and friends if you want file operations. See
@@ -42,7 +44,6 @@ void abort(void) {
}
void _exit(int status) {
printf("_exit(%d)\n", status);
abort();
}
@@ -52,3 +53,7 @@ int _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp) {
tp->tv_usec = time % 1000000;
return 0;
}
long int random(void) {
return os_random();
}
+7 -2
View File
@@ -37,6 +37,7 @@ void ev_handler(struct mg_connection *nc, int ev, void *p) {
case MG_EV_HTTP_REQUEST: {
char addr[32];
struct http_message *hm = (struct http_message *) p;
(void) hm;
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
LOG(LL_INFO,
@@ -100,9 +101,13 @@ xTaskHandle s_mg_task_handle;
void user_init(void) {
uart_div_modify(0, UART_CLK_FREQ / 115200);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
// setvbuf(stdout, NULL, _IONBF, 0);
// setvbuf(stderr, NULL, _IONBF, 0);
xTaskCreate(mg_task, (const signed char *) "mongoose", MG_TASK_STACK_SIZE,
NULL, MG_TASK_PRIORITY, &s_mg_task_handle);
}
void call_user_start(void) {
user_init();
}