Commit Graph

12 Commits

Author SHA1 Message Date
Alexander Steffen
299bc62586 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-07-18 11:57:39 +10:00
Paul Sokolovsky
5fae914326 esp8266/etshal.h: Adjust size of MD5_CTX structure.
Size 64 was incorrect and will lead to stack corruption. Size 88 was
verified empirically. Also, allow to skip defining it if MD5_CTX
preprocessor macro is already defined (to avoid header conflict).
2016-11-02 02:16:35 +03:00
Paul Sokolovsky
2ec70dc812 esp8266/etshal.h: Add prototypes for SPIRead/SPIWrite/SPIEraseSector. 2016-11-02 02:16:20 +03:00
Paul Sokolovsky
b6c22c42ab esp8266/etshal.h: Add few more ESP8266 vendor lib prototypes. 2016-10-23 16:43:07 +03:00
Paul Sokolovsky
015774a04f esp8266/modmachinewdt: Add .deinit() method. 2016-09-03 20:45:11 +03:00
Paul Sokolovsky
e33d2383d1 esp8266/modesp: Add check_fw() function to check integrity of the firmware.
Requires firmware generated by the latest makeimg.py (which stores size
and md5 of the firmware together with the firmware itself).
2016-08-04 00:29:19 +03:00
Paul Sokolovsky
76c81cd5a6 esp8266/modesp: Add malloc() and free() functions.
Useful for testing fragmentation issues in OS heap. E.g. freemem() may
report large amount, but is it possible to actually allocate block of
a given size? Issue malloc() (followed by free()) to find out.
2016-05-03 00:35:11 +03:00
Damien George
6ca17c1922 esp8266: Implement os.urandom function.
Uses what is suspected to be a hardware random number generator.
2016-03-29 10:29:57 +03:00
Damien George
077448328a esp8266/etshal.h: More prototypes of ESP8266 SDK/BootROM functions. 2016-03-05 21:56:32 +02:00
Paul Sokolovsky
f22a4f8e0a esp8266/etshal.h: Add timer functions prototypes. 2016-03-04 19:39:24 +02:00
Josef Gajdusek
492fd5cb6b esp8266: Enable setting CPU frequency to 160MHz 2015-05-28 21:28:29 +03:00
Damien George
075d597464 esp8266: New port of Micro Python to ESP8266 wifi module. 2014-11-27 20:30:33 +00:00