all: Unify header guard usage.
The code conventions suggest using header guards, but do not define how
those should look like and instead point to existing files. However, not
all existing files follow the same scheme, sometimes omitting header guards
altogether, sometimes using non-standard names, making it easy to
accidentally pick a "wrong" example.
This commit ensures that all header files of the MicroPython project (that
were not simply copied from somewhere else) follow the same pattern, that
was already present in the majority of files, especially in the py folder.
The rules are as follows.
Naming convention:
* start with the words MICROPY_INCLUDED
* contain the full path to the file
* replace special characters with _
In addition, there are no empty lines before #ifndef, between #ifndef and
one empty line before #endif. #endif is followed by a comment containing
the name of the guard macro.
py/grammar.h cannot use header guards by design, since it has to be
included multiple times in a single C file. Several other files also do not
need header guards as they are only used internally and guaranteed to be
included only once:
* MICROPY_MPHALPORT_H
* mpconfigboard.h
* mpconfigport.h
* mpthreadport.h
* pin_defs_*.h
* qstrdefs*.h
2017-06-29 17:14:58 -04:00
|
|
|
#ifndef MICROPY_INCLUDED_ESP8266_ETSHAL_H
|
|
|
|
#define MICROPY_INCLUDED_ESP8266_ETSHAL_H
|
2014-11-27 15:30:33 -05:00
|
|
|
|
2016-03-04 12:39:24 -05:00
|
|
|
#include <os_type.h>
|
|
|
|
|
2016-03-29 03:29:57 -04:00
|
|
|
// see http://esp8266-re.foogod.com/wiki/Random_Number_Generator
|
|
|
|
#define WDEV_HWRNG ((volatile uint32_t*)0x3ff20e44)
|
|
|
|
|
2017-11-04 18:27:21 -04:00
|
|
|
void ets_delay_us(uint16_t us);
|
2016-03-01 04:20:22 -05:00
|
|
|
void ets_intr_lock(void);
|
|
|
|
void ets_intr_unlock(void);
|
|
|
|
void ets_isr_mask(uint32_t mask);
|
|
|
|
void ets_isr_unmask(uint32_t mask);
|
|
|
|
void ets_isr_attach(int irq_no, void (*handler)(void *), void *arg);
|
2014-11-27 15:30:33 -05:00
|
|
|
void ets_install_putc1();
|
2017-11-04 18:27:21 -04:00
|
|
|
void uart_div_modify(uint8_t uart, uint32_t divisor);
|
2016-03-01 04:20:22 -05:00
|
|
|
void ets_set_idle_cb(void (*handler)(void *), void *arg);
|
2014-11-27 15:30:33 -05:00
|
|
|
|
2016-03-04 12:39:24 -05:00
|
|
|
void ets_timer_arm_new(os_timer_t *tim, uint32_t millis, bool repeat, bool is_milli_timer);
|
|
|
|
void ets_timer_setfn(os_timer_t *tim, ETSTimerFunc callback, void *cb_data);
|
|
|
|
void ets_timer_disarm(os_timer_t *tim);
|
|
|
|
|
2016-09-03 13:45:11 -04:00
|
|
|
extern void ets_wdt_disable(void);
|
|
|
|
extern void wdt_feed(void);
|
|
|
|
|
2016-08-03 17:29:19 -04:00
|
|
|
// Opaque structure
|
2016-11-01 18:47:03 -04:00
|
|
|
#ifndef MD5_CTX
|
|
|
|
typedef char MD5_CTX[88];
|
|
|
|
#endif
|
2016-08-03 17:29:19 -04:00
|
|
|
|
|
|
|
void MD5Init(MD5_CTX *context);
|
|
|
|
void MD5Update(MD5_CTX *context, const void *data, unsigned int len);
|
|
|
|
void MD5Final(unsigned char digest[16], MD5_CTX *context);
|
|
|
|
|
2016-05-02 17:35:11 -04:00
|
|
|
// These prototypes are for recent SDKs with "malloc tracking"
|
2017-11-04 18:27:21 -04:00
|
|
|
void *pvPortMalloc(size_t sz, const char *fname, unsigned line);
|
|
|
|
void *pvPortZalloc(size_t sz, const char *fname, unsigned line);
|
|
|
|
void *pvPortRealloc(void *p, unsigned sz, const char *fname, unsigned line);
|
|
|
|
void vPortFree(void *p, const char *fname, unsigned line);
|
2016-05-02 17:35:11 -04:00
|
|
|
|
2016-11-01 18:41:51 -04:00
|
|
|
uint32_t SPIRead(uint32_t offset, void *buf, uint32_t len);
|
|
|
|
uint32_t SPIWrite(uint32_t offset, const void *buf, uint32_t len);
|
|
|
|
uint32_t SPIEraseSector(int sector);
|
|
|
|
|
all: Unify header guard usage.
The code conventions suggest using header guards, but do not define how
those should look like and instead point to existing files. However, not
all existing files follow the same scheme, sometimes omitting header guards
altogether, sometimes using non-standard names, making it easy to
accidentally pick a "wrong" example.
This commit ensures that all header files of the MicroPython project (that
were not simply copied from somewhere else) follow the same pattern, that
was already present in the majority of files, especially in the py folder.
The rules are as follows.
Naming convention:
* start with the words MICROPY_INCLUDED
* contain the full path to the file
* replace special characters with _
In addition, there are no empty lines before #ifndef, between #ifndef and
one empty line before #endif. #endif is followed by a comment containing
the name of the guard macro.
py/grammar.h cannot use header guards by design, since it has to be
included multiple times in a single C file. Several other files also do not
need header guards as they are only used internally and guaranteed to be
included only once:
* MICROPY_MPHALPORT_H
* mpconfigboard.h
* mpconfigport.h
* mpthreadport.h
* pin_defs_*.h
* qstrdefs*.h
2017-06-29 17:14:58 -04:00
|
|
|
#endif // MICROPY_INCLUDED_ESP8266_ETSHAL_H
|