Update IDF to 3.2-3276a13 and esptool.py to 2.5.0 (#1878)

* TX Flow Control and Code cleanup

* Use semaphore instead of delay

TX functionality is done.

* Use single buffer and empty queue on exit

* Fix compile issues because of LwIP code relocation

* Add temporary header to fix Azure not compiling

* Fix AsyncUDP early init

* AsyncUDP Multicast fixes

* Add source mac address and rework multicast

* Allow redefinition of default pins for Serials 1 and 2

* Update IDF to 3276a13

* Update esptool.py to 2.5.0

* Fix sketches

* Fix log level in BluetoothSetial
This commit is contained in:
Me No Dev
2018-09-21 08:39:36 +02:00
committed by GitHub
parent 4e96bffe0e
commit 96822d783f
447 changed files with 37993 additions and 10849 deletions

View File

@ -1,3 +1,8 @@
/**
* @file
* OS abstraction layer
*/
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
@ -27,8 +32,8 @@
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
*/
#ifndef LWIP_HDR_SYS_H
#define LWIP_HDR_SYS_H
@ -115,134 +120,215 @@ typedef void (*lwip_thread_fn)(void *arg);
#else /* LWIP_COMPAT_MUTEX */
/** Create a new mutex
/**
* @ingroup sys_mutex
* Create a new mutex.
* Note that mutexes are expected to not be taken recursively by the lwIP code,
* so both implementation types (recursive or non-recursive) should work.
* @param mutex pointer to the mutex to create
* @return a new mutex */
* @return ERR_OK if successful, another err_t otherwise
*/
err_t sys_mutex_new(sys_mutex_t *mutex);
/** Lock a mutex
* @param mutex the mutex to lock */
/**
* @ingroup sys_mutex
* Lock a mutex
* @param mutex the mutex to lock
*/
void sys_mutex_lock(sys_mutex_t *mutex);
/** Unlock a mutex
* @param mutex the mutex to unlock */
/**
* @ingroup sys_mutex
* Unlock a mutex
* @param mutex the mutex to unlock
*/
void sys_mutex_unlock(sys_mutex_t *mutex);
/** Delete a semaphore
* @param mutex the mutex to delete */
/**
* @ingroup sys_mutex
* Delete a semaphore
* @param mutex the mutex to delete
*/
void sys_mutex_free(sys_mutex_t *mutex);
#ifndef sys_mutex_valid
/** Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid */
/**
* @ingroup sys_mutex
* Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid
*/
int sys_mutex_valid(sys_mutex_t *mutex);
#endif
#ifndef sys_mutex_set_invalid
/** Set a mutex invalid so that sys_mutex_valid returns 0 */
/**
* @ingroup sys_mutex
* Set a mutex invalid so that sys_mutex_valid returns 0
*/
void sys_mutex_set_invalid(sys_mutex_t *mutex);
#endif
#endif /* LWIP_COMPAT_MUTEX */
/* Semaphore functions: */
/** Create a new semaphore
/**
* @ingroup sys_sem
* Create a new semaphore
* @param sem pointer to the semaphore to create
* @param count initial count of the semaphore
* @return ERR_OK if successful, another err_t otherwise */
* @return ERR_OK if successful, another err_t otherwise
*/
err_t sys_sem_new(sys_sem_t *sem, u8_t count);
/** Signals a semaphore
* @param sem the semaphore to signal */
/**
* @ingroup sys_sem
* Signals a semaphore
* @param sem the semaphore to signal
*/
void sys_sem_signal(sys_sem_t *sem);
#if ESP_LWIP
/** Signals a semaphore (ISR version)
* @param sem the semaphore to signal
* @return non-zero if a higher priority task has been woken */
int sys_sem_signal_isr(sys_sem_t *sem);
/** Wait for a semaphore for the specified timeout
#endif
/**
* @ingroup sys_sem
* Wait for a semaphore for the specified timeout
* @param sem the semaphore to wait for
* @param timeout timeout in milliseconds to wait (0 = wait forever)
* @return time (in milliseconds) waited for the semaphore
* or SYS_ARCH_TIMEOUT on timeout */
* or SYS_ARCH_TIMEOUT on timeout
*/
u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout);
/** Delete a semaphore
* @param sem semaphore to delete */
/**
* @ingroup sys_sem
* Delete a semaphore
* @param sem semaphore to delete
*/
void sys_sem_free(sys_sem_t *sem);
/** Wait for a semaphore - forever/no timeout */
#define sys_sem_wait(sem) sys_arch_sem_wait(sem, 0)
#ifndef sys_sem_valid
/** Check if a semaphore is valid/allocated: return 1 for valid, 0 for invalid */
/**
* @ingroup sys_sem
* Check if a semaphore is valid/allocated: return 1 for valid, 0 for invalid
*/
int sys_sem_valid(sys_sem_t *sem);
#endif
#ifndef sys_sem_set_invalid
/** Set a semaphore invalid so that sys_sem_valid returns 0 */
/**
* @ingroup sys_sem
* Set a semaphore invalid so that sys_sem_valid returns 0
*/
void sys_sem_set_invalid(sys_sem_t *sem);
#endif
#ifndef sys_sem_valid_val
/** Same as sys_sem_valid() but taking a value, not a pointer */
/**
* Same as sys_sem_valid() but taking a value, not a pointer
*/
#define sys_sem_valid_val(sem) sys_sem_valid(&(sem))
#endif
#ifndef sys_sem_set_invalid_val
/** Same as sys_sem_set_invalid() but taking a value, not a pointer */
/**
* Same as sys_sem_set_invalid() but taking a value, not a pointer
*/
#define sys_sem_set_invalid_val(sem) sys_sem_set_invalid(&(sem))
#endif
/* Time functions. */
#ifndef sys_msleep
/**
* @ingroup sys_misc
* Sleep for specified number of ms
*/
void sys_msleep(u32_t ms); /* only has a (close to) 1 ms resolution. */
#endif
/* Mailbox functions. */
/** Create a new mbox of specified size
/**
* @ingroup sys_mbox
* Create a new mbox of specified size
* @param mbox pointer to the mbox to create
* @param size (minimum) number of messages in this mbox
* @return ERR_OK if successful, another err_t otherwise */
* @return ERR_OK if successful, another err_t otherwise
*/
err_t sys_mbox_new(sys_mbox_t *mbox, int size);
/** Post a message to an mbox - may not fail
/**
* @ingroup sys_mbox
* Post a message to an mbox - may not fail
* -> blocks if full, only used from tasks not from ISR
* @param mbox mbox to posts the message
* @param msg message to post (ATTENTION: can be NULL) */
* @param msg message to post (ATTENTION: can be NULL)
*/
void sys_mbox_post(sys_mbox_t *mbox, void *msg);
/** Try to post a message to an mbox - may fail if full or ISR
/**
* @ingroup sys_mbox
* Try to post a message to an mbox - may fail if full or ISR
* @param mbox mbox to posts the message
* @param msg message to post (ATTENTION: can be NULL) */
* @param msg message to post (ATTENTION: can be NULL)
*/
err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg);
/** Wait for a new message to arrive in the mbox
/**
* @ingroup sys_mbox
* Wait for a new message to arrive in the mbox
* @param mbox mbox to get a message from
* @param msg pointer where the message is stored
* @param timeout maximum time (in milliseconds) to wait for a message (0 = wait forever)
* @return time (in milliseconds) waited for a message, may be 0 if not waited
or SYS_ARCH_TIMEOUT on timeout
* The returned time has to be accurate to prevent timer jitter! */
* The returned time has to be accurate to prevent timer jitter!
*/
u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout);
/* Allow port to override with a macro, e.g. special timeout for sys_arch_mbox_fetch() */
#ifndef sys_arch_mbox_tryfetch
/** Wait for a new message to arrive in the mbox
/**
* @ingroup sys_mbox
* Wait for a new message to arrive in the mbox
* @param mbox mbox to get a message from
* @param msg pointer where the message is stored
* @return 0 (milliseconds) if a message has been received
* or SYS_MBOX_EMPTY if the mailbox is empty */
* or SYS_MBOX_EMPTY if the mailbox is empty
*/
u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg);
#endif
/** For now, we map straight to sys_arch implementation. */
/**
* For now, we map straight to sys_arch implementation.
*/
#define sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg)
/** Delete an mbox
* @param mbox mbox to delete */
/**
* @ingroup sys_mbox
* Delete an mbox
* @param mbox mbox to delete
*/
void sys_mbox_free(sys_mbox_t *mbox);
#define sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0)
#ifndef sys_mbox_valid
/** Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid */
/**
* @ingroup sys_mbox
* Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid
*/
int sys_mbox_valid(sys_mbox_t *mbox);
#endif
#ifndef sys_mbox_set_invalid
/** Set an mbox invalid so that sys_mbox_valid returns 0 */
/**
* @ingroup sys_mbox
* Set an mbox invalid so that sys_mbox_valid returns 0
*/
void sys_mbox_set_invalid(sys_mbox_t *mbox);
#endif
#ifndef sys_mbox_valid_val
/** Same as sys_mbox_valid() but taking a value, not a pointer */
/**
* Same as sys_mbox_valid() but taking a value, not a pointer
*/
#define sys_mbox_valid_val(mbox) sys_mbox_valid(&(mbox))
#endif
#ifndef sys_mbox_set_invalid_val
/** Same as sys_mbox_set_invalid() but taking a value, not a pointer */
/**
* Same as sys_mbox_set_invalid() but taking a value, not a pointer
*/
#define sys_mbox_set_invalid_val(mbox) sys_mbox_set_invalid(&(mbox))
#endif
/** The only thread function:
/**
* @ingroup sys_misc
* The only thread function:
* Creates a new thread
* ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!)
* @param name human-readable name for the thread (used for debugging purposes)
@ -258,12 +344,17 @@ sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg,
void sys_init(void);
#ifndef sys_jiffies
/** Ticks/jiffies since power up. */
/**
* Ticks/jiffies since power up.
*/
u32_t sys_jiffies(void);
#endif
/** Returns the current time in milliseconds,
* may be the same as sys_jiffies or at least based on it. */
/**
* @ingroup sys_time
* Returns the current time in milliseconds,
* may be the same as sys_jiffies or at least based on it.
*/
u32_t sys_now(void);
/* Critical Region Protection */
@ -279,13 +370,17 @@ u32_t sys_now(void);
*/
#if SYS_LIGHTWEIGHT_PROT
/** SYS_ARCH_DECL_PROTECT
/**
* @ingroup sys_prot
* SYS_ARCH_DECL_PROTECT
* declare a protection variable. This macro will default to defining a variable of
* type sys_prot_t. If a particular port needs a different implementation, then
* this macro may be defined in sys_arch.h.
*/
#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev
/** SYS_ARCH_PROTECT
/**
* @ingroup sys_prot
* SYS_ARCH_PROTECT
* Perform a "fast" protect. This could be implemented by
* disabling interrupts for an embedded system or by using a semaphore or
* mutex. The implementation should allow calling SYS_ARCH_PROTECT when
@ -295,7 +390,9 @@ u32_t sys_now(void);
* different implementation, then this macro may be defined in sys_arch.h
*/
#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect()
/** SYS_ARCH_UNPROTECT
/**
* @ingroup sys_prot
* SYS_ARCH_UNPROTECT
* Perform a "fast" set of the protection level to "lev". This could be
* implemented by setting the interrupt level to "lev" within the MACRO or by
* using a semaphore or mutex. This macro will default to calling the