feat(vfs): Modify for esp8266

This commit is contained in:
dongheng
2019-03-07 14:58:44 +08:00
parent e36706d776
commit d11543400e
25 changed files with 225 additions and 51 deletions

View File

@ -109,6 +109,14 @@ sys_sem_signal(sys_sem_t *sem)
xSemaphoreGive(*sem);
}
/*-----------------------------------------------------------------------------------*/
// Signals a semaphore (from ISR)
int sys_sem_signal_isr(sys_sem_t *sem)
{
BaseType_t woken = pdFALSE;
xSemaphoreGiveFromISR(*sem, &woken);
return woken == pdTRUE;
}
/*-----------------------------------------------------------------------------------*/
/*

View File

@ -37,6 +37,7 @@
#include "freertos/task.h"
#include "freertos/queue.h"
#include "freertos/semphr.h"
#include "arch/vfs_lwip.h"
typedef xSemaphoreHandle sys_sem_t;
typedef xSemaphoreHandle sys_mutex_t;

View File

@ -1412,7 +1412,11 @@ size_t memp_malloc_get_size(size_t type);
* Disable this option if you use a POSIX operating system that uses the same
* names (read, write & close). (only used if you use sockets.c)
*/
#ifdef CONFIG_USING_ESP_VFS
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
#else
#define LWIP_POSIX_SOCKETS_IO_NAMES 1
#endif
/**
* LWIP_SOCKET_OFFSET==n: Increases the file descriptor number created by LwIP with n.
@ -1421,7 +1425,7 @@ size_t memp_malloc_get_size(size_t type);
* re implement read/write/close/ioctl/fnctl to send the requested action to the right
* library (sharing select will need more work though).
*/
#define LWIP_SOCKET_OFFSET 0
#define LWIP_SOCKET_OFFSET (FD_SETSIZE - CONFIG_LWIP_MAX_SOCKETS)
/**
* LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT

View File

@ -1,20 +0,0 @@
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef __ESP_SYS_SELECT_H__
#define __ESP_SYS_SELECT_H__
#include "lwip/sockets.h"
#endif //__ESP_SYS_SELECT_H__