From 299bc625864b9e624ed599c94a5f95870516139a Mon Sep 17 00:00:00 2001 From: Alexander Steffen Date: Thu, 29 Jun 2017 23:14:58 +0200 Subject: [PATCH] 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 --- cc3200/bootmgr/bootmgr.h | 7 +++---- cc3200/bootmgr/flc.h | 7 +++---- cc3200/ftp/ftp.h | 7 +++---- cc3200/ftp/updater.h | 8 +++----- cc3200/hal/cc3200_hal.h | 5 ----- cc3200/misc/antenna.h | 7 +++---- cc3200/misc/mperror.h | 7 +++---- cc3200/misc/mpexception.h | 7 +++---- cc3200/misc/mpirq.h | 7 +++---- cc3200/mods/modnetwork.h | 7 +++---- cc3200/mods/modubinascii.h | 7 +++---- cc3200/mods/moduos.h | 7 +++---- cc3200/mods/modusocket.h | 7 +++---- cc3200/mods/modwlan.h | 7 +++---- cc3200/mods/pybadc.h | 7 +++---- cc3200/mods/pybi2c.h | 7 +++---- cc3200/mods/pybpin.h | 7 +++---- cc3200/mods/pybrtc.h | 7 +++---- cc3200/mods/pybsd.h | 6 +++--- cc3200/mods/pybsleep.h | 7 +++---- cc3200/mods/pybspi.h | 7 +++---- cc3200/mods/pybtimer.h | 3 +++ cc3200/mods/pybuart.h | 7 +++---- cc3200/mods/pybwdt.h | 7 +++---- cc3200/mpconfigport.h | 5 ----- cc3200/mptask.h | 7 +++---- cc3200/mpthreadport.h | 4 ---- cc3200/serverstask.h | 7 +++---- cc3200/telnet/telnet.h | 7 +++---- cc3200/util/cryptohash.h | 7 +++---- cc3200/util/fifo.h | 7 +++---- cc3200/util/gccollect.h | 4 ++++ cc3200/util/gchelper.h | 7 +++---- cc3200/util/random.h | 7 +++---- cc3200/util/sleeprestore.h | 7 +++---- cc3200/util/socketfifo.h | 7 +++---- cc3200/version.h | 7 +++---- drivers/dht/dht.h | 5 +++++ drivers/memory/spiflash.h | 1 - esp8266/esp_mphal.h | 5 ----- esp8266/espapa102.h | 4 ++++ esp8266/espneopixel.h | 5 +++++ esp8266/esppwm.h | 6 +++--- esp8266/ets_alt_task.h | 5 +++++ esp8266/etshal.h | 6 +++--- esp8266/gccollect.h | 4 ++++ esp8266/modmachine.h | 6 +++--- esp8266/uart.h | 6 +++--- esp8266/xtirq.h | 7 +++---- extmod/lwip-include/arch/cc.h | 6 +++--- extmod/lwip-include/arch/perf.h | 6 +++--- extmod/lwip-include/lwipopts.h | 7 +++---- extmod/machine_i2c.h | 7 +++---- extmod/machine_mem.h | 8 +++----- extmod/machine_pinbase.h | 8 +++----- extmod/machine_pulse.h | 7 +++---- extmod/machine_signal.h | 8 +++----- extmod/machine_spi.h | 1 - extmod/misc.h | 4 ++++ extmod/modubinascii.h | 7 +++---- extmod/modwebsocket.h | 5 +++++ extmod/utime_mphal.h | 4 ++++ extmod/vfs.h | 1 - extmod/vfs_fat.h | 4 ++++ extmod/virtpin.h | 4 ++++ lib/mp-readline/readline.h | 4 ++++ lib/netutils/netutils.h | 6 +++--- lib/timeutils/timeutils.h | 7 +++---- lib/utils/interrupt_char.h | 4 ++++ lib/utils/pyexec.h | 6 +++--- pic16bit/board.h | 6 +++--- pic16bit/modpyb.h | 6 +++--- pic16bit/pic16bit_mphal.h | 4 ---- pic16bit/unistd.h | 5 +++++ py/asmarm.h | 6 +++--- py/asmthumb.h | 6 +++--- py/asmx64.h | 6 +++--- py/asmx86.h | 6 +++--- py/bc.h | 6 +++--- py/bc0.h | 6 +++--- py/binary.h | 6 +++--- py/builtin.h | 6 +++--- py/compile.h | 6 +++--- py/emit.h | 7 +++---- py/emitglue.h | 6 +++--- py/formatfloat.h | 6 +++--- py/frozenmod.h | 6 +++--- py/gc.h | 6 +++--- py/lexer.h | 6 +++--- py/misc.h | 6 +++--- py/mpconfig.h | 6 +++--- py/mperrno.h | 7 +++---- py/mphal.h | 6 +++--- py/mpprint.h | 6 +++--- py/mpstate.h | 6 +++--- py/mpthread.h | 6 +++--- py/mpz.h | 6 +++--- py/nlr.h | 6 +++--- py/obj.h | 6 +++--- py/objarray.h | 7 +++---- py/objexcept.h | 6 +++--- py/objfun.h | 6 +++--- py/objgenerator.h | 6 +++--- py/objint.h | 6 +++--- py/objlist.h | 6 +++--- py/objmodule.h | 6 +++--- py/objstr.h | 6 +++--- py/objtuple.h | 6 +++--- py/objtype.h | 6 +++--- py/parse.h | 6 +++--- py/parsenum.h | 6 +++--- py/parsenumbase.h | 6 +++--- py/qstr.h | 6 +++--- py/repl.h | 6 +++--- py/ringbuf.h | 6 +++--- py/runtime.h | 6 +++--- py/runtime0.h | 6 +++--- py/scope.h | 6 +++--- py/smallint.h | 6 +++--- py/stackctrl.h | 6 +++--- py/stream.h | 6 +++--- py/unicode.h | 6 +++--- stmhal/accel.h | 4 ++++ stmhal/adc.h | 4 ++++ stmhal/bufhelper.h | 4 ++++ stmhal/can.h | 4 ++++ stmhal/dac.h | 4 ++++ stmhal/dma.h | 7 +++---- stmhal/extint.h | 4 ++++ stmhal/flash.h | 4 ++++ stmhal/font_petme128_8x8.h | 4 ++++ stmhal/gccollect.h | 4 ++++ stmhal/i2c.h | 4 ++++ stmhal/irq.h | 1 - stmhal/lcd.h | 4 ++++ stmhal/led.h | 4 ++++ stmhal/modmachine.h | 7 +++---- stmhal/modnetwork.h | 4 ++++ stmhal/mpconfigport.h | 6 ------ stmhal/mpthreadport.h | 4 ---- stmhal/pendsv.h | 4 ++++ stmhal/pin.h | 7 +++---- stmhal/portmodules.h | 4 ++++ stmhal/pybthread.h | 1 - stmhal/rng.h | 4 ++++ stmhal/rtc.h | 4 ++++ stmhal/sdcard.h | 4 ++++ stmhal/servo.h | 4 ++++ stmhal/spi.h | 4 ++++ stmhal/stm32_it.h | 4 ++++ stmhal/storage.h | 4 ++++ stmhal/systick.h | 4 ++++ stmhal/timer.h | 4 ++++ stmhal/uart.h | 4 ++++ stmhal/usb.h | 4 ++++ stmhal/usbd_cdc_interface.h | 4 ++++ stmhal/usbd_desc.h | 4 ++++ stmhal/usbd_hid_interface.h | 4 ++++ stmhal/usbd_msc_storage.h | 4 ++++ stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h | 7 +++---- stmhal/usrsw.h | 4 ++++ stmhal/wdt.h | 4 ++++ teensy/hal_ftm.h | 4 +++- teensy/led.h | 5 +++++ teensy/lexermemzip.h | 4 ++++ teensy/reg.h | 5 +++++ teensy/servo.h | 4 ++++ teensy/std.h | 5 +++++ teensy/timer.h | 4 ++++ teensy/usb.h | 5 +++++ unix/fdfile.h | 7 +++---- unix/input.h | 5 +++++ unix/mpthreadport.h | 4 ---- windows/fmode.h | 7 +++---- windows/init.h | 4 ++++ windows/msvc/dirent.h | 4 ++++ windows/msvc/sys/time.h | 4 ++++ windows/msvc/unistd.h | 4 ++++ windows/realpath.h | 4 ++++ windows/sleep.h | 4 ++++ zephyr/modmachine.h | 6 +++--- 181 files changed, 574 insertions(+), 414 deletions(-) diff --git a/cc3200/bootmgr/bootmgr.h b/cc3200/bootmgr/bootmgr.h index 4b314335c..e5285d4e4 100644 --- a/cc3200/bootmgr/bootmgr.h +++ b/cc3200/bootmgr/bootmgr.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __BOOTMGR_H__ -#define __BOOTMGR_H__ +#ifndef MICROPY_INCLUDED_CC3200_BOOTMGR_BOOTMGR_H +#define MICROPY_INCLUDED_CC3200_BOOTMGR_BOOTMGR_H //**************************************************************************** // @@ -66,4 +65,4 @@ extern void Run(unsigned long); } #endif -#endif //__BOOTMGR_H__ +#endif // MICROPY_INCLUDED_CC3200_BOOTMGR_BOOTMGR_H diff --git a/cc3200/bootmgr/flc.h b/cc3200/bootmgr/flc.h index 4b2aca9ac..7c04c7b05 100644 --- a/cc3200/bootmgr/flc.h +++ b/cc3200/bootmgr/flc.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __FLC_H__ -#define __FLC_H__ +#ifndef MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H +#define MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H /****************************************************************************** @@ -93,4 +92,4 @@ typedef struct _sBootInfo_t } #endif -#endif /* __FLC_H__ */ +#endif // MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H diff --git a/cc3200/ftp/ftp.h b/cc3200/ftp/ftp.h index 13b044dcf..7d16002e4 100644 --- a/cc3200/ftp/ftp.h +++ b/cc3200/ftp/ftp.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef FTP_H_ -#define FTP_H_ +#ifndef MICROPY_INCLUDED_CC3200_FTP_FTP_H +#define MICROPY_INCLUDED_CC3200_FTP_FTP_H /****************************************************************************** DECLARE EXPORTED FUNCTIONS @@ -36,4 +35,4 @@ extern void ftp_enable (void); extern void ftp_disable (void); extern void ftp_reset (void); -#endif /* FTP_H_ */ +#endif // MICROPY_INCLUDED_CC3200_FTP_FTP_H diff --git a/cc3200/ftp/updater.h b/cc3200/ftp/updater.h index b581d0fc8..dcca70472 100644 --- a/cc3200/ftp/updater.h +++ b/cc3200/ftp/updater.h @@ -23,10 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - - -#ifndef UPDATER_H_ -#define UPDATER_H_ +#ifndef MICROPY_INCLUDED_CC3200_FTP_UPDATER_H +#define MICROPY_INCLUDED_CC3200_FTP_UPDATER_H extern void updater_pre_init (void); extern bool updater_check_path (void *path); @@ -35,4 +33,4 @@ extern bool updater_write (uint8_t *buf, uint32_t len); extern void updater_finnish (void); extern bool updater_verify (uint8_t *rbuff, uint8_t *hasbuff); -#endif /* UPDATER_H_ */ +#endif // MICROPY_INCLUDED_CC3200_FTP_UPDATER_H diff --git a/cc3200/hal/cc3200_hal.h b/cc3200/hal/cc3200_hal.h index fcb85b292..9953f0e5a 100644 --- a/cc3200/hal/cc3200_hal.h +++ b/cc3200/hal/cc3200_hal.h @@ -24,9 +24,6 @@ * THE SOFTWARE. */ -#ifndef CC3200_LAUNCHXL_HAL_CC3200_HAL_H_ -#define CC3200_LAUNCHXL_HAL_CC3200_HAL_H_ - #include #include @@ -69,5 +66,3 @@ extern void mp_hal_set_interrupt_char (int c); #define mp_hal_delay_us(usec) UtilsDelay(UTILS_DELAY_US_TO_COUNT(usec)) #define mp_hal_ticks_cpu() (SysTickPeriodGet() - SysTickValueGet()) - -#endif /* CC3200_LAUNCHXL_HAL_CC3200_HAL_H_ */ diff --git a/cc3200/misc/antenna.h b/cc3200/misc/antenna.h index b3b1c6162..3bb87e32b 100644 --- a/cc3200/misc/antenna.h +++ b/cc3200/misc/antenna.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef _ANTENNA_H_ -#define _ANTENNA_H_ +#ifndef MICROPY_INCLUDED_CC3200_MISC_ANTENNA_H +#define MICROPY_INCLUDED_CC3200_MISC_ANTENNA_H typedef enum { ANTENNA_TYPE_INTERNAL = 0, @@ -35,4 +34,4 @@ typedef enum { extern void antenna_init0 (void); extern void antenna_select (antenna_type_t antenna_type); -#endif /* _ANTENNA_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MISC_ANTENNA_H diff --git a/cc3200/misc/mperror.h b/cc3200/misc/mperror.h index e38d129db..46a9b8cb0 100644 --- a/cc3200/misc/mperror.h +++ b/cc3200/misc/mperror.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MPERROR_H_ -#define MPERROR_H_ +#ifndef MICROPY_INCLUDED_CC3200_MISC_MPERROR_H +#define MICROPY_INCLUDED_CC3200_MISC_MPERROR_H extern void NORETURN __fatal_error(const char *msg); @@ -39,4 +38,4 @@ void mperror_heartbeat_signal (void); void mperror_enable_heartbeat (bool enable); bool mperror_is_heartbeat_enabled (void); -#endif // MPERROR_H_ +#endif // MICROPY_INCLUDED_CC3200_MISC_MPERROR_H diff --git a/cc3200/misc/mpexception.h b/cc3200/misc/mpexception.h index 2f9d1877c..d23381caf 100644 --- a/cc3200/misc/mpexception.h +++ b/cc3200/misc/mpexception.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MPEXCEPTION_H_ -#define MPEXCEPTION_H_ +#ifndef MICROPY_INCLUDED_CC3200_MISC_MPEXCEPTION_H +#define MICROPY_INCLUDED_CC3200_MISC_MPEXCEPTION_H extern const char mpexception_value_invalid_arguments[]; extern const char mpexception_num_type_invalid_arguments[]; @@ -40,4 +39,4 @@ extern void mpexception_set_interrupt_char (int c); extern void mpexception_nlr_jump (void *o); extern void mpexception_keyboard_nlr_jump (void); -#endif /* MPEXCEPTION_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MISC_MPEXCEPTION_H diff --git a/cc3200/misc/mpirq.h b/cc3200/misc/mpirq.h index 3fd21ee09..8b4ab2f1b 100644 --- a/cc3200/misc/mpirq.h +++ b/cc3200/misc/mpirq.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MPIRQ_H_ -#define MPIRQ_H_ +#ifndef MICROPY_INCLUDED_CC3200_MISC_MPIRQ_H +#define MICROPY_INCLUDED_CC3200_MISC_MPIRQ_H /****************************************************************************** DEFINE CONSTANTS @@ -72,4 +71,4 @@ void mp_irq_remove (const mp_obj_t parent); void mp_irq_handler (mp_obj_t self_in); uint mp_irq_translate_priority (uint priority); -#endif /* MPIRQ_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MISC_MPIRQ_H diff --git a/cc3200/mods/modnetwork.h b/cc3200/mods/modnetwork.h index 8a886c3e4..8e1196e86 100644 --- a/cc3200/mods/modnetwork.h +++ b/cc3200/mods/modnetwork.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MODNETWORK_H_ -#define MODNETWORK_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_MODNETWORK_H +#define MICROPY_INCLUDED_CC3200_MODS_MODNETWORK_H /****************************************************************************** DEFINE CONSTANTS @@ -71,4 +70,4 @@ extern const mod_network_nic_type_t mod_network_nic_type_wlan; ******************************************************************************/ void mod_network_init0(void); -#endif // MODNETWORK_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_MODNETWORK_H diff --git a/cc3200/mods/modubinascii.h b/cc3200/mods/modubinascii.h index c04b70021..3e784e9ae 100644 --- a/cc3200/mods/modubinascii.h +++ b/cc3200/mods/modubinascii.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MODUBINASCII_H_ -#define MODUBINASCII_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_MODUBINASCII_H +#define MICROPY_INCLUDED_CC3200_MODS_MODUBINASCII_H -#endif /* MODUBINASCII_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_MODUBINASCII_H diff --git a/cc3200/mods/moduos.h b/cc3200/mods/moduos.h index 4c8bc9659..148cddf2e 100644 --- a/cc3200/mods/moduos.h +++ b/cc3200/mods/moduos.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MODUOS_H_ -#define MODUOS_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_MODUOS_H +#define MICROPY_INCLUDED_CC3200_MODS_MODUOS_H #include "py/obj.h" @@ -45,4 +44,4 @@ typedef struct _os_term_dup_obj_t { ******************************************************************************/ void osmount_unmount_all (void); -#endif // MODUOS_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_MODUOS_H diff --git a/cc3200/mods/modusocket.h b/cc3200/mods/modusocket.h index 851f8e5be..80c1f24cd 100644 --- a/cc3200/mods/modusocket.h +++ b/cc3200/mods/modusocket.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MODUSOCKET_H_ -#define MODUSOCKET_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_MODUSOCKET_H +#define MICROPY_INCLUDED_CC3200_MODS_MODUSOCKET_H extern const mp_obj_dict_t socket_locals_dict; extern const mp_stream_p_t socket_stream_p; @@ -36,4 +35,4 @@ extern void modusocket_socket_delete (int16_t sd); extern void modusocket_enter_sleep (void); extern void modusocket_close_all_user_sockets (void); -#endif /* MODUSOCKET_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_MODUSOCKET_H diff --git a/cc3200/mods/modwlan.h b/cc3200/mods/modwlan.h index 3bfd1fbbf..d37d276e8 100644 --- a/cc3200/mods/modwlan.h +++ b/cc3200/mods/modwlan.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MODWLAN_H_ -#define MODWLAN_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_MODWLAN_H +#define MICROPY_INCLUDED_CC3200_MODS_MODWLAN_H /****************************************************************************** DEFINE CONSTANTS @@ -97,4 +96,4 @@ extern bool wlan_is_connected (void); extern void wlan_set_current_time (uint32_t seconds_since_2000); extern void wlan_off_on (void); -#endif /* MODWLAN_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_MODWLAN_H diff --git a/cc3200/mods/pybadc.h b/cc3200/mods/pybadc.h index b77c4af42..50640ee60 100644 --- a/cc3200/mods/pybadc.h +++ b/cc3200/mods/pybadc.h @@ -24,10 +24,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBADC_H_ -#define PYBADC_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBADC_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBADC_H extern const mp_obj_type_t pyb_adc_type; -#endif /* PYBADC_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBADC_H diff --git a/cc3200/mods/pybi2c.h b/cc3200/mods/pybi2c.h index 7adffb2d9..d547f6330 100644 --- a/cc3200/mods/pybi2c.h +++ b/cc3200/mods/pybi2c.h @@ -24,10 +24,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBI2C_H_ -#define PYBI2C_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBI2C_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBI2C_H extern const mp_obj_type_t pyb_i2c_type; -#endif // PYBI2C_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBI2C_H diff --git a/cc3200/mods/pybpin.h b/cc3200/mods/pybpin.h index ad02cc777..6b4b7b1ed 100644 --- a/cc3200/mods/pybpin.h +++ b/cc3200/mods/pybpin.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBPIN_H_ -#define PYBPIN_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBPIN_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBPIN_H enum { PORT_A0 = GPIOA0_BASE, @@ -138,4 +137,4 @@ uint8_t pin_find_peripheral_unit (const mp_obj_t pin, uint8_t fn, uint8_t type); uint8_t pin_find_peripheral_type (const mp_obj_t pin, uint8_t fn, uint8_t unit); int8_t pin_find_af_index (const pin_obj_t* pin, uint8_t fn, uint8_t unit, uint8_t type);; -#endif // PYBPIN_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBPIN_H diff --git a/cc3200/mods/pybrtc.h b/cc3200/mods/pybrtc.h index 5111b78f7..3fd11ecd6 100644 --- a/cc3200/mods/pybrtc.h +++ b/cc3200/mods/pybrtc.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBRTC_H_ -#define PYBRTC_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBRTC_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBRTC_H // RTC triggers #define PYB_RTC_ALARM0 (0x01) @@ -56,4 +55,4 @@ extern void pyb_rtc_calc_future_time (uint32_t a_mseconds, uint32_t *f_seconds, extern void pyb_rtc_repeat_alarm (pyb_rtc_obj_t *self); extern void pyb_rtc_disable_alarm (void); -#endif // PYBRTC_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBRTC_H diff --git a/cc3200/mods/pybsd.h b/cc3200/mods/pybsd.h index a06df6d8d..084d7caaf 100644 --- a/cc3200/mods/pybsd.h +++ b/cc3200/mods/pybsd.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef PYBSD_H_ -#define PYBSD_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBSD_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBSD_H /****************************************************************************** DEFINE PUBLIC TYPES @@ -41,4 +41,4 @@ typedef struct { extern pybsd_obj_t pybsd_obj; extern const mp_obj_type_t pyb_sd_type; -#endif // PYBSD_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBSD_H diff --git a/cc3200/mods/pybsleep.h b/cc3200/mods/pybsleep.h index d34895ae0..513e6fa95 100644 --- a/cc3200/mods/pybsleep.h +++ b/cc3200/mods/pybsleep.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBSLEEP_H_ -#define PYBSLEEP_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBSLEEP_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBSLEEP_H /****************************************************************************** DEFINE CONSTANTS @@ -70,4 +69,4 @@ void pyb_sleep_deepsleep (void); pybsleep_reset_cause_t pyb_sleep_get_reset_cause (void); pybsleep_wake_reason_t pyb_sleep_get_wake_reason (void); -#endif /* PYBSLEEP_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBSLEEP_H diff --git a/cc3200/mods/pybspi.h b/cc3200/mods/pybspi.h index 48e0edd61..b533b6056 100644 --- a/cc3200/mods/pybspi.h +++ b/cc3200/mods/pybspi.h @@ -24,10 +24,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBSPI_H_ -#define PYBSPI_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBSPI_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBSPI_H extern const mp_obj_type_t pyb_spi_type; -#endif // PYBSPI_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBSPI_H diff --git a/cc3200/mods/pybtimer.h b/cc3200/mods/pybtimer.h index 4e9de138d..a1b30cd2b 100644 --- a/cc3200/mods/pybtimer.h +++ b/cc3200/mods/pybtimer.h @@ -24,6 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBTIMER_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBTIMER_H /****************************************************************************** DECLARE EXPORTED DATA @@ -35,3 +37,4 @@ extern const mp_obj_type_t pyb_timer_type; ******************************************************************************/ void timer_init0 (void); +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBTIMER_H diff --git a/cc3200/mods/pybuart.h b/cc3200/mods/pybuart.h index 19bc93607..56440987f 100644 --- a/cc3200/mods/pybuart.h +++ b/cc3200/mods/pybuart.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBUART_H_ -#define PYBUART_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBUART_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBUART_H typedef enum { PYB_UART_0 = 0, @@ -43,4 +42,4 @@ int uart_rx_char(pyb_uart_obj_t *uart_obj); bool uart_tx_char(pyb_uart_obj_t *self, int c); bool uart_tx_strn(pyb_uart_obj_t *uart_obj, const char *str, uint len); -#endif // PYBUART_H_ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBUART_H diff --git a/cc3200/mods/pybwdt.h b/cc3200/mods/pybwdt.h index f87f0a773..2844587cb 100644 --- a/cc3200/mods/pybwdt.h +++ b/cc3200/mods/pybwdt.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef PYBWDT_H_ -#define PYBWDT_H_ +#ifndef MICROPY_INCLUDED_CC3200_MODS_PYBWDT_H +#define MICROPY_INCLUDED_CC3200_MODS_PYBWDT_H #include "py/obj.h" @@ -36,4 +35,4 @@ void pybwdt_srv_alive (void); void pybwdt_srv_sleeping (bool state); void pybwdt_sl_alive (void); -#endif /* PYBWDT_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MODS_PYBWDT_H diff --git a/cc3200/mpconfigport.h b/cc3200/mpconfigport.h index 4bd583a4b..78f8c0948 100644 --- a/cc3200/mpconfigport.h +++ b/cc3200/mpconfigport.h @@ -25,9 +25,6 @@ * THE SOFTWARE. */ -#ifndef __INCLUDED_MPCONFIGPORT_H -#define __INCLUDED_MPCONFIGPORT_H - #include #ifndef BOOTLOADER @@ -235,5 +232,3 @@ typedef long mp_off_t; #define MICROPY_PORT_WLAN_AP_KEY "www.wipy.io" #define MICROPY_PORT_WLAN_AP_SECURITY SL_SEC_TYPE_WPA_WPA2 #define MICROPY_PORT_WLAN_AP_CHANNEL 5 - -#endif // __INCLUDED_MPCONFIGPORT_H diff --git a/cc3200/mptask.h b/cc3200/mptask.h index e0d2f0eec..9276cfc3e 100644 --- a/cc3200/mptask.h +++ b/cc3200/mptask.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MPTASK_H_ -#define MPTASK_H_ +#ifndef MICROPY_INCLUDED_CC3200_MPTASK_H +#define MICROPY_INCLUDED_CC3200_MPTASK_H /****************************************************************************** DEFINE CONSTANTS @@ -44,4 +43,4 @@ extern StackType_t mpTaskStack[]; ******************************************************************************/ extern void TASK_Micropython (void *pvParameters); -#endif /* MPTASK_H_ */ +#endif // MICROPY_INCLUDED_CC3200_MPTASK_H diff --git a/cc3200/mpthreadport.h b/cc3200/mpthreadport.h index 2b49232dd..dc9ba9920 100644 --- a/cc3200/mpthreadport.h +++ b/cc3200/mpthreadport.h @@ -23,8 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_CC3200_MPTHREADPORT_H__ -#define __MICROPY_INCLUDED_CC3200_MPTHREADPORT_H__ #ifndef BOOTLOADER #include "FreeRTOS.h" @@ -39,5 +37,3 @@ typedef struct _mp_thread_mutex_t { void mp_thread_init(void); void mp_thread_gc_others(void); - -#endif // __MICROPY_INCLUDED_CC3200_MPTHREADPORT_H__ diff --git a/cc3200/serverstask.h b/cc3200/serverstask.h index 2786ff697..77a3af2f3 100644 --- a/cc3200/serverstask.h +++ b/cc3200/serverstask.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef SERVERSTASK_H_ -#define SERVERSTASK_H_ +#ifndef MICROPY_INCLUDED_CC3200_SERVERSTASK_H +#define MICROPY_INCLUDED_CC3200_SERVERSTASK_H /****************************************************************************** DEFINE CONSTANTS @@ -73,4 +72,4 @@ extern void server_sleep_sockets (void); extern void servers_set_timeout (uint32_t timeout); extern uint32_t servers_get_timeout (void); -#endif /* SERVERSTASK_H_ */ +#endif // MICROPY_INCLUDED_CC3200_SERVERSTASK_H diff --git a/cc3200/telnet/telnet.h b/cc3200/telnet/telnet.h index aa5531394..1e3173b11 100644 --- a/cc3200/telnet/telnet.h +++ b/cc3200/telnet/telnet.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef TELNET_H_ -#define TELNET_H_ +#ifndef MICROPY_INCLUDED_CC3200_TELNET_TELNET_H +#define MICROPY_INCLUDED_CC3200_TELNET_TELNET_H /****************************************************************************** DECLARE EXPORTED FUNCTIONS @@ -39,4 +38,4 @@ extern void telnet_enable (void); extern void telnet_disable (void); extern void telnet_reset (void); -#endif /* TELNET_H_ */ +#endif // MICROPY_INCLUDED_CC3200_TELNET_TELNET_H diff --git a/cc3200/util/cryptohash.h b/cc3200/util/cryptohash.h index d9f624d19..df3a8475c 100644 --- a/cc3200/util/cryptohash.h +++ b/cc3200/util/cryptohash.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef CRYPTOHASH_H_ -#define CRYPTOHASH_H_ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_CRYPTOHASH_H +#define MICROPY_INCLUDED_CC3200_UTIL_CRYPTOHASH_H /****************************************************************************** DECLARE PUBLIC FUNCTIONS @@ -35,4 +34,4 @@ extern void CRYPTOHASH_SHAMD5Start (uint32_t algo, uint32_t blocklen); extern void CRYPTOHASH_SHAMD5Update (uint8_t *data, uint32_t datalen); extern void CRYPTOHASH_SHAMD5Read (uint8_t *hash); -#endif /* CRYPTOHASH_H_ */ +#endif // MICROPY_INCLUDED_CC3200_UTIL_CRYPTOHASH_H diff --git a/cc3200/util/fifo.h b/cc3200/util/fifo.h index c8590f5c2..ee7571c26 100644 --- a/cc3200/util/fifo.h +++ b/cc3200/util/fifo.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef FIFO_H_ -#define FIFO_H_ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_FIFO_H +#define MICROPY_INCLUDED_CC3200_UTIL_FIFO_H typedef struct { void *pvElements; @@ -47,4 +46,4 @@ extern bool FIFO_IsEmpty (FIFO_t *fifo); extern bool FIFO_IsFull (FIFO_t *fifo); extern void FIFO_Flush (FIFO_t *fifo); -#endif /* FIFO_H_ */ +#endif // MICROPY_INCLUDED_CC3200_UTIL_FIFO_H diff --git a/cc3200/util/gccollect.h b/cc3200/util/gccollect.h index 281e84aa8..3c4232b84 100644 --- a/cc3200/util/gccollect.h +++ b/cc3200/util/gccollect.h @@ -24,6 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_GCCOLLECT_H +#define MICROPY_INCLUDED_CC3200_UTIL_GCCOLLECT_H // variables defining memory layout extern uint32_t _etext; @@ -39,3 +41,5 @@ extern uint32_t _stack; extern uint32_t _estack; void gc_collect(void); + +#endif // MICROPY_INCLUDED_CC3200_UTIL_GCCOLLECT_H diff --git a/cc3200/util/gchelper.h b/cc3200/util/gchelper.h index 1f7d2fece..0277a754b 100644 --- a/cc3200/util/gchelper.h +++ b/cc3200/util/gchelper.h @@ -24,11 +24,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef GC_HELPER_H_ -#define GC_HELPER_H_ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_GCHELPER_H +#define MICROPY_INCLUDED_CC3200_UTIL_GCHELPER_H extern mp_uint_t gc_helper_get_sp(void); extern mp_uint_t gc_helper_get_regs_and_sp(mp_uint_t *regs); -#endif /* GC_HELPER_H_ */ +#endif // MICROPY_INCLUDED_CC3200_UTIL_GCHELPER_H diff --git a/cc3200/util/random.h b/cc3200/util/random.h index 67fd1ff85..60b0b8663 100644 --- a/cc3200/util/random.h +++ b/cc3200/util/random.h @@ -23,13 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __RANDOM_H -#define __RANDOM_H +#ifndef MICROPY_INCLUDED_CC3200_UTIL_RANDOM_H +#define MICROPY_INCLUDED_CC3200_UTIL_RANDOM_H void rng_init0 (void); uint32_t rng_get (void); MP_DECLARE_CONST_FUN_OBJ_0(machine_rng_get_obj); -#endif // __RANDOM_H +#endif // MICROPY_INCLUDED_CC3200_UTIL_RANDOM_H diff --git a/cc3200/util/sleeprestore.h b/cc3200/util/sleeprestore.h index 51416f0fc..1c5509db0 100644 --- a/cc3200/util/sleeprestore.h +++ b/cc3200/util/sleeprestore.h @@ -23,11 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef SLEEPRESTORE_H_ -#define SLEEPRESTORE_H_ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_SLEEPRESTORE_H +#define MICROPY_INCLUDED_CC3200_UTIL_SLEEPRESTORE_H extern void sleep_store(void); extern void sleep_restore(void); -#endif /* SLEEPRESTORE_H_ */ +#endif // MICROPY_INCLUDED_CC3200_UTIL_SLEEPRESTORE_H diff --git a/cc3200/util/socketfifo.h b/cc3200/util/socketfifo.h index 69b17658f..1309201ee 100644 --- a/cc3200/util/socketfifo.h +++ b/cc3200/util/socketfifo.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef SOCKETFIFO_H_ -#define SOCKETFIFO_H_ +#ifndef MICROPY_INCLUDED_CC3200_UTIL_SOCKETFIFO_H +#define MICROPY_INCLUDED_CC3200_UTIL_SOCKETFIFO_H /*---------------------------------------------------------------------------- ** Imports @@ -60,4 +59,4 @@ extern bool SOCKETFIFO_IsFull (void); extern void SOCKETFIFO_Flush (void); extern unsigned int SOCKETFIFO_Count (void); -#endif /* SOCKETFIFO_H_ */ +#endif // MICROPY_INCLUDED_CC3200_UTIL_SOCKETFIFO_H diff --git a/cc3200/version.h b/cc3200/version.h index c8315d771..83e3f8c07 100644 --- a/cc3200/version.h +++ b/cc3200/version.h @@ -23,10 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef VERSION_H_ -#define VERSION_H_ +#ifndef MICROPY_INCLUDED_CC3200_VERSION_H +#define MICROPY_INCLUDED_CC3200_VERSION_H #define WIPY_SW_VERSION_NUMBER "1.2.0" -#endif /* VERSION_H_ */ +#endif // MICROPY_INCLUDED_CC3200_VERSION_H diff --git a/drivers/dht/dht.h b/drivers/dht/dht.h index 20954036d..883e07796 100644 --- a/drivers/dht/dht.h +++ b/drivers/dht/dht.h @@ -1,3 +1,8 @@ +#ifndef MICROPY_INCLUDED_DRIVERS_DHT_DHT_H +#define MICROPY_INCLUDED_DRIVERS_DHT_DHT_H + #include "py/obj.h" MP_DECLARE_CONST_FUN_OBJ_2(dht_readinto_obj); + +#endif // MICROPY_INCLUDED_DRIVERS_DHT_DHT_H diff --git a/drivers/memory/spiflash.h b/drivers/memory/spiflash.h index d2e817450..967352b04 100644 --- a/drivers/memory/spiflash.h +++ b/drivers/memory/spiflash.h @@ -23,7 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #ifndef MICROPY_INCLUDED_DRIVERS_MEMORY_SPIFLASH_H #define MICROPY_INCLUDED_DRIVERS_MEMORY_SPIFLASH_H diff --git a/esp8266/esp_mphal.h b/esp8266/esp_mphal.h index d783f1f09..1d1d6de3f 100644 --- a/esp8266/esp_mphal.h +++ b/esp8266/esp_mphal.h @@ -24,9 +24,6 @@ * THE SOFTWARE. */ -#ifndef _INCLUDED_MPHAL_H_ -#define _INCLUDED_MPHAL_H_ - #include "py/ringbuf.h" #include "lib/utils/interrupt_char.h" #include "xtirq.h" @@ -96,5 +93,3 @@ void mp_hal_pin_open_drain(mp_hal_pin_obj_t pin); void *ets_get_esf_buf_ctlblk(void); int ets_esf_free_bufs(int idx); - -#endif // _INCLUDED_MPHAL_H_ diff --git a/esp8266/espapa102.h b/esp8266/espapa102.h index 82c92025d..dd7c5ab72 100644 --- a/esp8266/espapa102.h +++ b/esp8266/espapa102.h @@ -23,5 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_ESP8266_ESPAPA102_H +#define MICROPY_INCLUDED_ESP8266_ESPAPA102_H void esp_apa102_write(uint8_t clockPin, uint8_t dataPin, uint8_t *pixels, uint32_t numBytes); + +#endif // MICROPY_INCLUDED_ESP8266_ESPAPA102_H diff --git a/esp8266/espneopixel.h b/esp8266/espneopixel.h index 4b20afda5..c444740ff 100644 --- a/esp8266/espneopixel.h +++ b/esp8266/espneopixel.h @@ -1 +1,6 @@ +#ifndef MICROPY_INCLUDED_ESP8266_ESPNEOPIXEL_H +#define MICROPY_INCLUDED_ESP8266_ESPNEOPIXEL_H + void esp_neopixel_write(uint8_t pin, uint8_t *pixels, uint32_t numBytes, bool is800KHz); + +#endif // MICROPY_INCLUDED_ESP8266_ESPNEOPIXEL_H diff --git a/esp8266/esppwm.h b/esp8266/esppwm.h index 242a9a2a6..1ee4a2f55 100644 --- a/esp8266/esppwm.h +++ b/esp8266/esppwm.h @@ -1,5 +1,5 @@ -#ifndef __ESPPWM_H__ -#define __ESPPWM_H__ +#ifndef MICROPY_INCLUDED_ESP8266_ESPPWM_H +#define MICROPY_INCLUDED_ESP8266_ESPPWM_H #include #include @@ -14,4 +14,4 @@ uint16_t pwm_get_freq(uint8_t channel); int pwm_add(uint8_t pin_id, uint32_t pin_mux, uint32_t pin_func); bool pwm_delete(uint8_t channel); -#endif +#endif // MICROPY_INCLUDED_ESP8266_ESPPWM_H diff --git a/esp8266/ets_alt_task.h b/esp8266/ets_alt_task.h index dba0c5fa6..33a9d3a00 100644 --- a/esp8266/ets_alt_task.h +++ b/esp8266/ets_alt_task.h @@ -1,4 +1,9 @@ +#ifndef MICROPY_INCLUDED_ESP8266_ETS_ALT_TASK_H +#define MICROPY_INCLUDED_ESP8266_ETS_ALT_TASK_H + extern int ets_loop_iter_disable; extern uint32_t system_time_high_word; bool ets_loop_iter(void); + +#endif // MICROPY_INCLUDED_ESP8266_ETS_ALT_TASK_H diff --git a/esp8266/etshal.h b/esp8266/etshal.h index 90af63ba2..34787779f 100644 --- a/esp8266/etshal.h +++ b/esp8266/etshal.h @@ -1,5 +1,5 @@ -#ifndef _INCLUDED_ETSHAL_H_ -#define _INCLUDED_ETSHAL_H_ +#ifndef MICROPY_INCLUDED_ESP8266_ETSHAL_H +#define MICROPY_INCLUDED_ESP8266_ETSHAL_H #include @@ -42,4 +42,4 @@ 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); -#endif // _INCLUDED_ETSHAL_H_ +#endif // MICROPY_INCLUDED_ESP8266_ETSHAL_H diff --git a/esp8266/gccollect.h b/esp8266/gccollect.h index d81cba12c..0aee42771 100644 --- a/esp8266/gccollect.h +++ b/esp8266/gccollect.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_ESP8266_GCCOLLECT_H +#define MICROPY_INCLUDED_ESP8266_GCCOLLECT_H extern uint32_t _text_start; extern uint32_t _text_end; @@ -39,3 +41,5 @@ extern uint32_t _heap_end; void gc_collect(void); void esp_native_code_gc_collect(void); + +#endif // MICROPY_INCLUDED_ESP8266_GCCOLLECT_H diff --git a/esp8266/modmachine.h b/esp8266/modmachine.h index 414aaa85b..eae351f68 100644 --- a/esp8266/modmachine.h +++ b/esp8266/modmachine.h @@ -1,5 +1,5 @@ -#ifndef __MICROPY_INCLUDED_ESP8266_MODPYB_H__ -#define __MICROPY_INCLUDED_ESP8266_MODPYB_H__ +#ifndef MICROPY_INCLUDED_ESP8266_MODMACHINE_H +#define MICROPY_INCLUDED_ESP8266_MODMACHINE_H #include "py/obj.h" @@ -38,4 +38,4 @@ void pyb_rtc_set_us_since_2000(uint64_t nowus); uint64_t pyb_rtc_get_us_since_2000(); void rtc_prepare_deepsleep(uint64_t sleep_us); -#endif // __MICROPY_INCLUDED_ESP8266_MODPYB_H__ +#endif // MICROPY_INCLUDED_ESP8266_MODMACHINE_H diff --git a/esp8266/uart.h b/esp8266/uart.h index f6850c42d..ebcd8b051 100644 --- a/esp8266/uart.h +++ b/esp8266/uart.h @@ -1,5 +1,5 @@ -#ifndef _INCLUDED_UART_H_ -#define _INCLUDED_UART_H_ +#ifndef MICROPY_INCLUDED_ESP8266_UART_H +#define MICROPY_INCLUDED_ESP8266_UART_H #include @@ -103,4 +103,4 @@ void uart_setup(uint8 uart); int uart_rx_any(uint8 uart); int uart_tx_any_room(uint8 uart); -#endif // _INCLUDED_UART_H_ +#endif // MICROPY_INCLUDED_ESP8266_UART_H diff --git a/esp8266/xtirq.h b/esp8266/xtirq.h index 856ff075a..595052fc7 100644 --- a/esp8266/xtirq.h +++ b/esp8266/xtirq.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_ESP8266_XTIRQ_H__ -#define __MICROPY_INCLUDED_ESP8266_XTIRQ_H__ +#ifndef MICROPY_INCLUDED_ESP8266_XTIRQ_H +#define MICROPY_INCLUDED_ESP8266_XTIRQ_H #include @@ -57,4 +56,4 @@ static inline void enable_irq(uint32_t irq_state) { restore_irq_pri(irq_state); } -#endif // __MICROPY_INCLUDED_ESP8266_XTIRQ_H__ +#endif // MICROPY_INCLUDED_ESP8266_XTIRQ_H diff --git a/extmod/lwip-include/arch/cc.h b/extmod/lwip-include/arch/cc.h index 0a7907d34..400dc6ec7 100644 --- a/extmod/lwip-include/arch/cc.h +++ b/extmod/lwip-include/arch/cc.h @@ -1,5 +1,5 @@ -#ifndef __CC_H__ -#define __CC_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_CC_H +#define MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_CC_H #include @@ -38,4 +38,4 @@ typedef u32_t mem_ptr_t; #define PACK_STRUCT_BEGIN #define PACK_STRUCT_END -#endif /* __ARCH_CC_H__ */ +#endif // MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_CC_H diff --git a/extmod/lwip-include/arch/perf.h b/extmod/lwip-include/arch/perf.h index 51710701a..d310fc339 100644 --- a/extmod/lwip-include/arch/perf.h +++ b/extmod/lwip-include/arch/perf.h @@ -1,7 +1,7 @@ -#ifndef __PERF_H__ -#define __PERF_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_PERF_H +#define MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_PERF_H #define PERF_START /* null definition */ #define PERF_STOP(x) /* null definition */ -#endif /* __PERF_H__ */ +#endif // MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_ARCH_PERF_H diff --git a/extmod/lwip-include/lwipopts.h b/extmod/lwip-include/lwipopts.h index e4a33b238..2122f30f0 100644 --- a/extmod/lwip-include/lwipopts.h +++ b/extmod/lwip-include/lwipopts.h @@ -1,5 +1,5 @@ -#ifndef __LWIPOPTS_H__ -#define __LWIPOPTS_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_LWIPOPTS_H +#define MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_LWIPOPTS_H #include #include @@ -32,5 +32,4 @@ typedef uint32_t sys_prot_t; // things like this into a port-provided header file. #define sys_now mp_hal_ticks_ms -#endif - +#endif // MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_LWIPOPTS_H diff --git a/extmod/machine_i2c.h b/extmod/machine_i2c.h index d49ff01e4..f5af6656f 100644 --- a/extmod/machine_i2c.h +++ b/extmod/machine_i2c.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H__ -#define __MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H +#define MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H #include "py/obj.h" @@ -54,4 +53,4 @@ extern const mp_obj_dict_t mp_machine_soft_i2c_locals_dict; int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t *dest, size_t len, bool stop); int mp_machine_soft_i2c_writeto(mp_obj_base_t *self_in, uint16_t addr, const uint8_t *src, size_t len, bool stop); -#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H__ +#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H diff --git a/extmod/machine_mem.h b/extmod/machine_mem.h index fddd7d46c..4bc9ac127 100644 --- a/extmod/machine_mem.h +++ b/extmod/machine_mem.h @@ -23,10 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - - -#ifndef __MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H__ -#define __MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H +#define MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H #include "py/obj.h" @@ -48,4 +46,4 @@ uintptr_t MICROPY_MACHINE_MEM_GET_READ_ADDR(mp_obj_t addr_o, uint align); uintptr_t MICROPY_MACHINE_MEM_GET_WRITE_ADDR(mp_obj_t addr_o, uint align); #endif -#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H__ +#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_MEM_H diff --git a/extmod/machine_pinbase.h b/extmod/machine_pinbase.h index ece3384cc..c96abbc46 100644 --- a/extmod/machine_pinbase.h +++ b/extmod/machine_pinbase.h @@ -23,13 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - - -#ifndef __MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H__ -#define __MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H +#define MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H #include "py/obj.h" extern const mp_obj_type_t machine_pinbase_type; -#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H__ +#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_PINBASE_H diff --git a/extmod/machine_pulse.h b/extmod/machine_pulse.h index cc1c4eda5..e303dca02 100644 --- a/extmod/machine_pulse.h +++ b/extmod/machine_pulse.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H__ -#define __MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H +#define MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H #include "py/obj.h" #include "py/mphal.h" @@ -34,4 +33,4 @@ mp_uint_t machine_time_pulse_us(mp_hal_pin_obj_t pin, int pulse_level, mp_uint_t MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_time_pulse_us_obj); -#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H__ +#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H diff --git a/extmod/machine_signal.h b/extmod/machine_signal.h index 7f88cbaa8..df1c3e2e9 100644 --- a/extmod/machine_signal.h +++ b/extmod/machine_signal.h @@ -23,13 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - - -#ifndef __MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H__ -#define __MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H__ +#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H +#define MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H #include "py/obj.h" extern const mp_obj_type_t machine_signal_type; -#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H__ +#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_SIGNAL_H diff --git a/extmod/machine_spi.h b/extmod/machine_spi.h index 88a3e19f4..e24e41eb3 100644 --- a/extmod/machine_spi.h +++ b/extmod/machine_spi.h @@ -23,7 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H #define MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H diff --git a/extmod/misc.h b/extmod/misc.h index d7ead0654..6c13592c7 100644 --- a/extmod/misc.h +++ b/extmod/misc.h @@ -24,6 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_EXTMOD_MISC_H +#define MICROPY_INCLUDED_EXTMOD_MISC_H // This file contains cumulative declarations for extmod/ . @@ -38,3 +40,5 @@ void mp_uos_deactivate(const char *msg, mp_obj_t exc); #else #define mp_uos_dupterm_tx_strn(s, l) #endif + +#endif // MICROPY_INCLUDED_EXTMOD_MISC_H diff --git a/extmod/modubinascii.h b/extmod/modubinascii.h index 33d0f1cbd..6c0156fc4 100644 --- a/extmod/modubinascii.h +++ b/extmod/modubinascii.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef MICROPY_EXTMOD_MODUBINASCII -#define MICROPY_EXTMOD_MODUBINASCII +#ifndef MICROPY_INCLUDED_EXTMOD_MODUBINASCII_H +#define MICROPY_INCLUDED_EXTMOD_MODUBINASCII_H extern mp_obj_t mod_binascii_hexlify(size_t n_args, const mp_obj_t *args); extern mp_obj_t mod_binascii_unhexlify(mp_obj_t data); @@ -39,4 +38,4 @@ MP_DECLARE_CONST_FUN_OBJ_1(mod_binascii_a2b_base64_obj); MP_DECLARE_CONST_FUN_OBJ_1(mod_binascii_b2a_base64_obj); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mod_binascii_crc32_obj); -#endif /* MICROPY_EXTMOD_MODUBINASCII */ +#endif // MICROPY_INCLUDED_EXTMOD_MODUBINASCII_H diff --git a/extmod/modwebsocket.h b/extmod/modwebsocket.h index 7da147561..2720147df 100644 --- a/extmod/modwebsocket.h +++ b/extmod/modwebsocket.h @@ -1,5 +1,10 @@ +#ifndef MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H +#define MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H + #define FRAME_OPCODE_MASK 0x0f enum { FRAME_CONT, FRAME_TXT, FRAME_BIN, FRAME_CLOSE = 0x8, FRAME_PING, FRAME_PONG }; + +#endif // MICROPY_INCLUDED_EXTMOD_MODWEBSOCKET_H diff --git a/extmod/utime_mphal.h b/extmod/utime_mphal.h index 644387b67..88a9ed4d3 100644 --- a/extmod/utime_mphal.h +++ b/extmod/utime_mphal.h @@ -24,6 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_EXTMOD_UTIME_MPHAL_H +#define MICROPY_INCLUDED_EXTMOD_UTIME_MPHAL_H #include "py/obj.h" @@ -35,3 +37,5 @@ MP_DECLARE_CONST_FUN_OBJ_0(mp_utime_ticks_us_obj); MP_DECLARE_CONST_FUN_OBJ_0(mp_utime_ticks_cpu_obj); MP_DECLARE_CONST_FUN_OBJ_2(mp_utime_ticks_diff_obj); MP_DECLARE_CONST_FUN_OBJ_2(mp_utime_ticks_add_obj); + +#endif // MICROPY_INCLUDED_EXTMOD_UTIME_MPHAL_H diff --git a/extmod/vfs.h b/extmod/vfs.h index edaeb5349..f2efdbe79 100644 --- a/extmod/vfs.h +++ b/extmod/vfs.h @@ -23,7 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #ifndef MICROPY_INCLUDED_EXTMOD_VFS_H #define MICROPY_INCLUDED_EXTMOD_VFS_H diff --git a/extmod/vfs_fat.h b/extmod/vfs_fat.h index 6c7c05a9a..63c4abb82 100644 --- a/extmod/vfs_fat.h +++ b/extmod/vfs_fat.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_EXTMOD_VFS_FAT_H +#define MICROPY_INCLUDED_EXTMOD_VFS_FAT_H #include "py/lexer.h" #include "py/obj.h" @@ -58,3 +60,5 @@ mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode) MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj); mp_obj_t fat_vfs_ilistdir2(struct _fs_user_mount_t *vfs, const char *path, bool is_str_type); + +#endif // MICROPY_INCLUDED_EXTMOD_VFS_FAT_H diff --git a/extmod/virtpin.h b/extmod/virtpin.h index 041010350..706affc19 100644 --- a/extmod/virtpin.h +++ b/extmod/virtpin.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_EXTMOD_VIRTPIN_H +#define MICROPY_INCLUDED_EXTMOD_VIRTPIN_H #include "py/obj.h" @@ -41,3 +43,5 @@ void mp_virtual_pin_write(mp_obj_t pin, int value); // If a port exposes a Pin object, it's constructor should be like this mp_obj_t mp_pin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args); + +#endif // MICROPY_INCLUDED_EXTMOD_VIRTPIN_H diff --git a/lib/mp-readline/readline.h b/lib/mp-readline/readline.h index f73934d23..f53fdeaa8 100644 --- a/lib/mp-readline/readline.h +++ b/lib/mp-readline/readline.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_LIB_MP_READLINE_READLINE_H +#define MICROPY_INCLUDED_LIB_MP_READLINE_READLINE_H #define CHAR_CTRL_A (1) #define CHAR_CTRL_B (2) @@ -42,3 +44,5 @@ void readline_push_history(const char *line); void readline_init(vstr_t *line, const char *prompt); void readline_note_newline(const char *prompt); int readline_process_char(int c); + +#endif // MICROPY_INCLUDED_LIB_MP_READLINE_READLINE_H diff --git a/lib/netutils/netutils.h b/lib/netutils/netutils.h index 45e021640..1e147afa9 100644 --- a/lib/netutils/netutils.h +++ b/lib/netutils/netutils.h @@ -24,8 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_LIB_NETUTILS_H__ -#define __MICROPY_INCLUDED_LIB_NETUTILS_H__ +#ifndef MICROPY_INCLUDED_LIB_NETUTILS_NETUTILS_H +#define MICROPY_INCLUDED_LIB_NETUTILS_NETUTILS_H #define NETUTILS_IPV4ADDR_BUFSIZE 4 @@ -47,4 +47,4 @@ void netutils_parse_ipv4_addr(mp_obj_t addr_in, uint8_t *out_ip, netutils_endian // puts IP in out_ip (which must take at least IPADDR_BUF_SIZE bytes). mp_uint_t netutils_parse_inet_addr(mp_obj_t addr_in, uint8_t *out_ip, netutils_endian_t endian); -#endif // __MICROPY_INCLUDED_LIB_NETUTILS_H__ +#endif // MICROPY_INCLUDED_LIB_NETUTILS_NETUTILS_H diff --git a/lib/timeutils/timeutils.h b/lib/timeutils/timeutils.h index c3f1fc2db..1dc486e2e 100644 --- a/lib/timeutils/timeutils.h +++ b/lib/timeutils/timeutils.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_LIB_TIMEUTILS_H__ -#define __MICROPY_INCLUDED_LIB_TIMEUTILS_H__ +#ifndef MICROPY_INCLUDED_LIB_TIMEUTILS_TIMEUTILS_H +#define MICROPY_INCLUDED_LIB_TIMEUTILS_TIMEUTILS_H typedef struct _timeutils_struct_time_t { uint16_t tm_year; // i.e. 2014 @@ -52,4 +51,4 @@ mp_uint_t timeutils_seconds_since_2000(mp_uint_t year, mp_uint_t month, mp_uint_t timeutils_mktime(mp_uint_t year, mp_int_t month, mp_int_t mday, mp_int_t hours, mp_int_t minutes, mp_int_t seconds); -#endif // __MICROPY_INCLUDED_LIB_TIMEUTILS_H__ +#endif // MICROPY_INCLUDED_LIB_TIMEUTILS_TIMEUTILS_H diff --git a/lib/utils/interrupt_char.h b/lib/utils/interrupt_char.h index ae0bf57e8..ca50d4d56 100644 --- a/lib/utils/interrupt_char.h +++ b/lib/utils/interrupt_char.h @@ -23,7 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H +#define MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H extern int mp_interrupt_char; void mp_hal_set_interrupt_char(int c); void mp_keyboard_interrupt(void); + +#endif // MICROPY_INCLUDED_LIB_UTILS_INTERRUPT_CHAR_H diff --git a/lib/utils/pyexec.h b/lib/utils/pyexec.h index 0c7567e27..69cdb4762 100644 --- a/lib/utils/pyexec.h +++ b/lib/utils/pyexec.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H__ -#define __MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H__ +#ifndef MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H +#define MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H typedef enum { PYEXEC_MODE_RAW_REPL, @@ -51,4 +51,4 @@ extern uint8_t pyexec_repl_active; MP_DECLARE_CONST_FUN_OBJ_1(pyb_set_repl_info_obj); -#endif // __MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H__ +#endif // MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H diff --git a/pic16bit/board.h b/pic16bit/board.h index 0eb022436..f79dd3497 100644 --- a/pic16bit/board.h +++ b/pic16bit/board.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PIC16BIT_BOARD_H__ -#define __MICROPY_INCLUDED_PIC16BIT_BOARD_H__ +#ifndef MICROPY_INCLUDED_PIC16BIT_BOARD_H +#define MICROPY_INCLUDED_PIC16BIT_BOARD_H void cpu_init(void); @@ -40,4 +40,4 @@ int uart_rx_any(void); int uart_rx_char(void); void uart_tx_char(int chr); -#endif // __MICROPY_INCLUDED_PIC16BIT_BOARD_H__ +#endif // MICROPY_INCLUDED_PIC16BIT_BOARD_H diff --git a/pic16bit/modpyb.h b/pic16bit/modpyb.h index 6c68cbdfd..910ec1b6e 100644 --- a/pic16bit/modpyb.h +++ b/pic16bit/modpyb.h @@ -23,11 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PIC16BIT_MODPYB_H__ -#define __MICROPY_INCLUDED_PIC16BIT_MODPYB_H__ +#ifndef MICROPY_INCLUDED_PIC16BIT_MODPYB_H +#define MICROPY_INCLUDED_PIC16BIT_MODPYB_H extern const mp_obj_type_t pyb_led_type; extern const mp_obj_type_t pyb_switch_type; extern const mp_obj_module_t pyb_module; -#endif // __MICROPY_INCLUDED_PIC16BIT_MODPYB_H__ +#endif // MICROPY_INCLUDED_PIC16BIT_MODPYB_H diff --git a/pic16bit/pic16bit_mphal.h b/pic16bit/pic16bit_mphal.h index a858f7e0f..ffcca41bf 100644 --- a/pic16bit/pic16bit_mphal.h +++ b/pic16bit/pic16bit_mphal.h @@ -23,13 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PIC16BIT_PIC16BIT_MPHAL_H__ -#define __MICROPY_INCLUDED_PIC16BIT_PIC16BIT_MPHAL_H__ #include "py/mpstate.h" void mp_hal_init(void); void mp_hal_set_interrupt_char(int c); - -#endif // __MICROPY_INCLUDED_PIC16BIT_PIC16BIT_MPHAL_H__ diff --git a/pic16bit/unistd.h b/pic16bit/unistd.h index cdd9fe061..5b60c8a62 100644 --- a/pic16bit/unistd.h +++ b/pic16bit/unistd.h @@ -1,5 +1,10 @@ +#ifndef MICROPY_INCLUDED_PIC16BIT_UNISTD_H +#define MICROPY_INCLUDED_PIC16BIT_UNISTD_H + // XC16 compiler doesn't seem to have unistd.h file #define SEEK_CUR 1 typedef int ssize_t; + +#endif // MICROPY_INCLUDED_PIC16BIT_UNISTD_H diff --git a/py/asmarm.h b/py/asmarm.h index e273b98d7..c5900925f 100644 --- a/py/asmarm.h +++ b/py/asmarm.h @@ -24,8 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_ASMARM_H__ -#define __MICROPY_INCLUDED_PY_ASMARM_H__ +#ifndef MICROPY_INCLUDED_PY_ASMARM_H +#define MICROPY_INCLUDED_PY_ASMARM_H #include "py/misc.h" #include "py/asmbase.h" @@ -202,4 +202,4 @@ void asm_arm_bl_ind(asm_arm_t *as, void *fun_ptr, uint fun_id, uint reg_temp); #endif // GENERIC_ASM_API -#endif // __MICROPY_INCLUDED_PY_ASMARM_H__ +#endif // MICROPY_INCLUDED_PY_ASMARM_H diff --git a/py/asmthumb.h b/py/asmthumb.h index 52e663b3b..589c481cd 100644 --- a/py/asmthumb.h +++ b/py/asmthumb.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_ASMTHUMB_H__ -#define __MICROPY_INCLUDED_PY_ASMTHUMB_H__ +#ifndef MICROPY_INCLUDED_PY_ASMTHUMB_H +#define MICROPY_INCLUDED_PY_ASMTHUMB_H #include "py/misc.h" #include "py/asmbase.h" @@ -318,4 +318,4 @@ void asm_thumb_bl_ind(asm_thumb_t *as, void *fun_ptr, uint fun_id, uint reg_temp #endif // GENERIC_ASM_API -#endif // __MICROPY_INCLUDED_PY_ASMTHUMB_H__ +#endif // MICROPY_INCLUDED_PY_ASMTHUMB_H diff --git a/py/asmx64.h b/py/asmx64.h index 4499c53c3..a384cca00 100644 --- a/py/asmx64.h +++ b/py/asmx64.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_ASMX64_H__ -#define __MICROPY_INCLUDED_PY_ASMX64_H__ +#ifndef MICROPY_INCLUDED_PY_ASMX64_H +#define MICROPY_INCLUDED_PY_ASMX64_H #include "py/mpconfig.h" #include "py/misc.h" @@ -197,4 +197,4 @@ void asm_x64_call_ind(asm_x64_t* as, void* ptr, int temp_r32); #endif // GENERIC_ASM_API -#endif // __MICROPY_INCLUDED_PY_ASMX64_H__ +#endif // MICROPY_INCLUDED_PY_ASMX64_H diff --git a/py/asmx86.h b/py/asmx86.h index 0b44af663..fd34228d1 100644 --- a/py/asmx86.h +++ b/py/asmx86.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_ASMX86_H__ -#define __MICROPY_INCLUDED_PY_ASMX86_H__ +#ifndef MICROPY_INCLUDED_PY_ASMX86_H +#define MICROPY_INCLUDED_PY_ASMX86_H #include "py/mpconfig.h" #include "py/misc.h" @@ -195,4 +195,4 @@ void asm_x86_call_ind(asm_x86_t* as, void* ptr, mp_uint_t n_args, int temp_r32); #endif // GENERIC_ASM_API -#endif // __MICROPY_INCLUDED_PY_ASMX86_H__ +#endif // MICROPY_INCLUDED_PY_ASMX86_H diff --git a/py/bc.h b/py/bc.h index 88045dc55..c55d31fe4 100644 --- a/py/bc.h +++ b/py/bc.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_BC_H__ -#define __MICROPY_INCLUDED_PY_BC_H__ +#ifndef MICROPY_INCLUDED_PY_BC_H +#define MICROPY_INCLUDED_PY_BC_H #include "py/runtime.h" #include "py/obj.h" @@ -119,4 +119,4 @@ uint mp_opcode_format(const byte *ip, size_t *opcode_size); #endif -#endif // __MICROPY_INCLUDED_PY_BC_H__ +#endif // MICROPY_INCLUDED_PY_BC_H diff --git a/py/bc0.h b/py/bc0.h index b5650abe4..be8ac6c15 100644 --- a/py/bc0.h +++ b/py/bc0.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_BC0_H__ -#define __MICROPY_INCLUDED_PY_BC0_H__ +#ifndef MICROPY_INCLUDED_PY_BC0_H +#define MICROPY_INCLUDED_PY_BC0_H // Micro Python byte-codes. // The comment at the end of the line (if it exists) tells the arguments to the byte-code. @@ -116,4 +116,4 @@ #define MP_BC_UNARY_OP_MULTI (0xd0) // + op(7) #define MP_BC_BINARY_OP_MULTI (0xd7) // + op(36) -#endif // __MICROPY_INCLUDED_PY_BC0_H__ +#endif // MICROPY_INCLUDED_PY_BC0_H diff --git a/py/binary.h b/py/binary.h index 997d878c8..04cc6d83b 100644 --- a/py/binary.h +++ b/py/binary.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_BINARY_H__ -#define __MICROPY_INCLUDED_PY_BINARY_H__ +#ifndef MICROPY_INCLUDED_PY_BINARY_H +#define MICROPY_INCLUDED_PY_BINARY_H #include "py/obj.h" @@ -41,4 +41,4 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte ** long long mp_binary_get_int(mp_uint_t size, bool is_signed, bool big_endian, const byte *src); void mp_binary_set_int(mp_uint_t val_sz, bool big_endian, byte *dest, mp_uint_t val); -#endif // __MICROPY_INCLUDED_PY_BINARY_H__ +#endif // MICROPY_INCLUDED_PY_BINARY_H diff --git a/py/builtin.h b/py/builtin.h index ec326d037..4915383f2 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_BUILTIN_H__ -#define __MICROPY_INCLUDED_PY_BUILTIN_H__ +#ifndef MICROPY_INCLUDED_PY_BUILTIN_H +#define MICROPY_INCLUDED_PY_BUILTIN_H #include "py/obj.h" @@ -120,4 +120,4 @@ extern const mp_obj_module_t mp_module_btree; extern const char *MICROPY_PY_BUILTINS_HELP_TEXT; -#endif // __MICROPY_INCLUDED_PY_BUILTIN_H__ +#endif // MICROPY_INCLUDED_PY_BUILTIN_H diff --git a/py/compile.h b/py/compile.h index 45a98588d..f6b262d18 100644 --- a/py/compile.h +++ b/py/compile.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_COMPILE_H__ -#define __MICROPY_INCLUDED_PY_COMPILE_H__ +#ifndef MICROPY_INCLUDED_PY_COMPILE_H +#define MICROPY_INCLUDED_PY_COMPILE_H #include "py/lexer.h" #include "py/parse.h" @@ -51,4 +51,4 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f // this is implemented in runtime.c mp_obj_t mp_parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t parse_input_kind, mp_obj_dict_t *globals, mp_obj_dict_t *locals); -#endif // __MICROPY_INCLUDED_PY_COMPILE_H__ +#endif // MICROPY_INCLUDED_PY_COMPILE_H diff --git a/py/emit.h b/py/emit.h index 0236a9b8d..a58e20e3d 100644 --- a/py/emit.h +++ b/py/emit.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_PY_EMIT_H__ -#define __MICROPY_INCLUDED_PY_EMIT_H__ +#ifndef MICROPY_INCLUDED_PY_EMIT_H +#define MICROPY_INCLUDED_PY_EMIT_H #include "py/lexer.h" #include "py/scope.h" @@ -284,4 +283,4 @@ void mp_emitter_warning(pass_kind_t pass, const char *msg); #define mp_emitter_warning(pass, msg) #endif -#endif // __MICROPY_INCLUDED_PY_EMIT_H__ +#endif // MICROPY_INCLUDED_PY_EMIT_H diff --git a/py/emitglue.h b/py/emitglue.h index 37c4f1b18..309996596 100644 --- a/py/emitglue.h +++ b/py/emitglue.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_EMITGLUE_H__ -#define __MICROPY_INCLUDED_PY_EMITGLUE_H__ +#ifndef MICROPY_INCLUDED_PY_EMITGLUE_H +#define MICROPY_INCLUDED_PY_EMITGLUE_H #include "py/obj.h" @@ -74,4 +74,4 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_t def_args, mp_obj_t def_kw_args); mp_obj_t mp_make_closure_from_raw_code(const mp_raw_code_t *rc, mp_uint_t n_closed_over, const mp_obj_t *args); -#endif // __MICROPY_INCLUDED_PY_EMITGLUE_H__ +#endif // MICROPY_INCLUDED_PY_EMITGLUE_H diff --git a/py/formatfloat.h b/py/formatfloat.h index 019603447..9c8d137bb 100644 --- a/py/formatfloat.h +++ b/py/formatfloat.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_FORMATFLOAT_H__ -#define __MICROPY_INCLUDED_PY_FORMATFLOAT_H__ +#ifndef MICROPY_INCLUDED_PY_FORMATFLOAT_H +#define MICROPY_INCLUDED_PY_FORMATFLOAT_H #include "py/mpconfig.h" @@ -32,4 +32,4 @@ int mp_format_float(mp_float_t f, char *buf, size_t bufSize, char fmt, int prec, char sign); #endif -#endif // __MICROPY_INCLUDED_PY_FORMATFLOAT_H__ +#endif // MICROPY_INCLUDED_PY_FORMATFLOAT_H diff --git a/py/frozenmod.h b/py/frozenmod.h index 7c1299b2c..6993167ac 100644 --- a/py/frozenmod.h +++ b/py/frozenmod.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_FROZENMOD_H__ -#define __MICROPY_INCLUDED_PY_FROZENMOD_H__ +#ifndef MICROPY_INCLUDED_PY_FROZENMOD_H +#define MICROPY_INCLUDED_PY_FROZENMOD_H #include "py/lexer.h" @@ -38,4 +38,4 @@ int mp_find_frozen_module(const char *str, size_t len, void **data); const char *mp_find_frozen_str(const char *str, size_t *len); mp_import_stat_t mp_frozen_stat(const char *str); -#endif // __MICROPY_INCLUDED_PY_FROZENMOD_H__ +#endif // MICROPY_INCLUDED_PY_FROZENMOD_H diff --git a/py/gc.h b/py/gc.h index 7d8fe2bf8..136695517 100644 --- a/py/gc.h +++ b/py/gc.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_GC_H__ -#define __MICROPY_INCLUDED_PY_GC_H__ +#ifndef MICROPY_INCLUDED_PY_GC_H +#define MICROPY_INCLUDED_PY_GC_H #include @@ -64,4 +64,4 @@ void gc_info(gc_info_t *info); void gc_dump_info(void); void gc_dump_alloc_table(void); -#endif // __MICROPY_INCLUDED_PY_GC_H__ +#endif // MICROPY_INCLUDED_PY_GC_H diff --git a/py/lexer.h b/py/lexer.h index 5d998b352..435aa096b 100644 --- a/py/lexer.h +++ b/py/lexer.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_LEXER_H__ -#define __MICROPY_INCLUDED_PY_LEXER_H__ +#ifndef MICROPY_INCLUDED_PY_LEXER_H +#define MICROPY_INCLUDED_PY_LEXER_H #include @@ -192,4 +192,4 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename); mp_lexer_t *mp_lexer_new_from_fd(qstr filename, int fd, bool close_fd); #endif -#endif // __MICROPY_INCLUDED_PY_LEXER_H__ +#endif // MICROPY_INCLUDED_PY_LEXER_H diff --git a/py/misc.h b/py/misc.h index 5ac0f933a..cebbd38ea 100644 --- a/py/misc.h +++ b/py/misc.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MISC_H__ -#define __MICROPY_INCLUDED_PY_MISC_H__ +#ifndef MICROPY_INCLUDED_PY_MISC_H +#define MICROPY_INCLUDED_PY_MISC_H // a mini library of useful types and functions @@ -223,4 +223,4 @@ static inline mp_uint_t count_lead_ones(byte val) { #define MP_FLOAT_EXP_BIAS ((1 << (MP_FLOAT_EXP_BITS - 1)) - 1) #endif // MICROPY_PY_BUILTINS_FLOAT -#endif // __MICROPY_INCLUDED_PY_MISC_H__ +#endif // MICROPY_INCLUDED_PY_MISC_H diff --git a/py/mpconfig.h b/py/mpconfig.h index 32d64828d..fb507a503 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPCONFIG_H__ -#define __MICROPY_INCLUDED_PY_MPCONFIG_H__ +#ifndef MICROPY_INCLUDED_PY_MPCONFIG_H +#define MICROPY_INCLUDED_PY_MPCONFIG_H // This file contains default configuration settings for MicroPython. // You can override any of the options below using mpconfigport.h file @@ -1253,4 +1253,4 @@ typedef double mp_float_t; #define MP_UNLIKELY(x) __builtin_expect((x), 0) #endif -#endif // __MICROPY_INCLUDED_PY_MPCONFIG_H__ +#endif // MICROPY_INCLUDED_PY_MPCONFIG_H diff --git a/py/mperrno.h b/py/mperrno.h index 6ea99ae22..c515ed488 100644 --- a/py/mperrno.h +++ b/py/mperrno.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_PY_MPERRNO_H__ -#define __MICROPY_INCLUDED_PY_MPERRNO_H__ +#ifndef MICROPY_INCLUDED_PY_MPERRNO_H +#define MICROPY_INCLUDED_PY_MPERRNO_H #if MICROPY_USE_INTERNAL_ERRNO @@ -142,4 +141,4 @@ qstr mp_errno_to_str(mp_obj_t errno_val); #endif -#endif // __MICROPY_INCLUDED_PY_MPERRNO_H__ +#endif // MICROPY_INCLUDED_PY_MPERRNO_H diff --git a/py/mphal.h b/py/mphal.h index 8d5654f9e..93a0a40ce 100644 --- a/py/mphal.h +++ b/py/mphal.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPHAL_H__ -#define __MICROPY_INCLUDED_PY_MPHAL_H__ +#ifndef MICROPY_INCLUDED_PY_MPHAL_H +#define MICROPY_INCLUDED_PY_MPHAL_H #include "py/mpconfig.h" @@ -80,4 +80,4 @@ mp_uint_t mp_hal_ticks_cpu(void); #include "extmod/virtpin.h" #endif -#endif // __MICROPY_INCLUDED_PY_MPHAL_H__ +#endif // MICROPY_INCLUDED_PY_MPHAL_H diff --git a/py/mpprint.h b/py/mpprint.h index 4fc904a20..20bd875b4 100644 --- a/py/mpprint.h +++ b/py/mpprint.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPPRINT_H__ -#define __MICROPY_INCLUDED_PY_MPPRINT_H__ +#ifndef MICROPY_INCLUDED_PY_MPPRINT_H +#define MICROPY_INCLUDED_PY_MPPRINT_H #include "py/mpconfig.h" @@ -71,4 +71,4 @@ int mp_printf(const mp_print_t *print, const char *fmt, ...); int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args); #endif -#endif // __MICROPY_INCLUDED_PY_MPPRINT_H__ +#endif // MICROPY_INCLUDED_PY_MPPRINT_H diff --git a/py/mpstate.h b/py/mpstate.h index 2b8f29a6a..b09ba08cf 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPSTATE_H__ -#define __MICROPY_INCLUDED_PY_MPSTATE_H__ +#ifndef MICROPY_INCLUDED_PY_MPSTATE_H +#define MICROPY_INCLUDED_PY_MPSTATE_H #include @@ -248,4 +248,4 @@ extern mp_state_thread_t *mp_thread_get_state(void); #define MP_STATE_THREAD(x) (mp_state_ctx.thread.x) #endif -#endif // __MICROPY_INCLUDED_PY_MPSTATE_H__ +#endif // MICROPY_INCLUDED_PY_MPSTATE_H diff --git a/py/mpthread.h b/py/mpthread.h index 04d4f1968..602df830c 100644 --- a/py/mpthread.h +++ b/py/mpthread.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPTHREAD_H__ -#define __MICROPY_INCLUDED_PY_MPTHREAD_H__ +#ifndef MICROPY_INCLUDED_PY_MPTHREAD_H +#define MICROPY_INCLUDED_PY_MPTHREAD_H #include "py/mpconfig.h" @@ -58,4 +58,4 @@ void mp_thread_mutex_unlock(mp_thread_mutex_t *mutex); #define MP_THREAD_GIL_EXIT() #endif -#endif // __MICROPY_INCLUDED_PY_MPTHREAD_H__ +#endif // MICROPY_INCLUDED_PY_MPTHREAD_H diff --git a/py/mpz.h b/py/mpz.h index 5c8822722..878febf8b 100644 --- a/py/mpz.h +++ b/py/mpz.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_MPZ_H__ -#define __MICROPY_INCLUDED_PY_MPZ_H__ +#ifndef MICROPY_INCLUDED_PY_MPZ_H +#define MICROPY_INCLUDED_PY_MPZ_H #include @@ -139,4 +139,4 @@ mp_float_t mpz_as_float(const mpz_t *z); #endif size_t mpz_as_str_inpl(const mpz_t *z, unsigned int base, const char *prefix, char base_char, char comma, char *str); -#endif // __MICROPY_INCLUDED_PY_MPZ_H__ +#endif // MICROPY_INCLUDED_PY_MPZ_H diff --git a/py/nlr.h b/py/nlr.h index 7a71ef34b..624e97307 100644 --- a/py/nlr.h +++ b/py/nlr.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_NLR_H__ -#define __MICROPY_INCLUDED_PY_NLR_H__ +#ifndef MICROPY_INCLUDED_PY_NLR_H +#define MICROPY_INCLUDED_PY_NLR_H // non-local return // exception handling, basically a stack of setjmp/longjmp buffers @@ -112,4 +112,4 @@ NORETURN void nlr_jump_fail(void *val); #endif -#endif // __MICROPY_INCLUDED_PY_NLR_H__ +#endif // MICROPY_INCLUDED_PY_NLR_H diff --git a/py/obj.h b/py/obj.h index a3c06a261..f88c10004 100644 --- a/py/obj.h +++ b/py/obj.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJ_H__ -#define __MICROPY_INCLUDED_PY_OBJ_H__ +#ifndef MICROPY_INCLUDED_PY_OBJ_H +#define MICROPY_INCLUDED_PY_OBJ_H #include "py/mpconfig.h" #include "py/misc.h" @@ -864,4 +864,4 @@ mp_obj_t mp_seq_extract_slice(size_t len, const mp_obj_t *seq, mp_bound_slice_t memmove(((char*)dest) + (beg + slice_len) * (item_sz), ((char*)dest) + (end) * (item_sz), ((dest_len) + (len_adj) - ((beg) + (slice_len))) * (item_sz)); \ memmove(((char*)dest) + (beg) * (item_sz), slice, slice_len * (item_sz)); -#endif // __MICROPY_INCLUDED_PY_OBJ_H__ +#endif // MICROPY_INCLUDED_PY_OBJ_H diff --git a/py/objarray.h b/py/objarray.h index 06a2a07ef..038966845 100644 --- a/py/objarray.h +++ b/py/objarray.h @@ -24,9 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_PY_OBJARRAY_H__ -#define __MICROPY_INCLUDED_PY_OBJARRAY_H__ +#ifndef MICROPY_INCLUDED_PY_OBJARRAY_H +#define MICROPY_INCLUDED_PY_OBJARRAY_H #include "py/obj.h" @@ -40,4 +39,4 @@ typedef struct _mp_obj_array_t { void *items; } mp_obj_array_t; -#endif // __MICROPY_INCLUDED_PY_OBJARRAY_H__ +#endif // MICROPY_INCLUDED_PY_OBJARRAY_H diff --git a/py/objexcept.h b/py/objexcept.h index 3128fded7..2232e1e21 100644 --- a/py/objexcept.h +++ b/py/objexcept.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJEXCEPT_H__ -#define __MICROPY_INCLUDED_PY_OBJEXCEPT_H__ +#ifndef MICROPY_INCLUDED_PY_OBJEXCEPT_H +#define MICROPY_INCLUDED_PY_OBJEXCEPT_H #include "py/obj.h" #include "py/objtuple.h" @@ -37,4 +37,4 @@ typedef struct _mp_obj_exception_t { mp_obj_tuple_t *args; } mp_obj_exception_t; -#endif // __MICROPY_INCLUDED_PY_OBJEXCEPT_H__ +#endif // MICROPY_INCLUDED_PY_OBJEXCEPT_H diff --git a/py/objfun.h b/py/objfun.h index d02fada9b..450c98f76 100644 --- a/py/objfun.h +++ b/py/objfun.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJFUN_H__ -#define __MICROPY_INCLUDED_PY_OBJFUN_H__ +#ifndef MICROPY_INCLUDED_PY_OBJFUN_H +#define MICROPY_INCLUDED_PY_OBJFUN_H #include "py/obj.h" @@ -41,4 +41,4 @@ typedef struct _mp_obj_fun_bc_t { mp_obj_t extra_args[]; } mp_obj_fun_bc_t; -#endif // __MICROPY_INCLUDED_PY_OBJFUN_H__ +#endif // MICROPY_INCLUDED_PY_OBJFUN_H diff --git a/py/objgenerator.h b/py/objgenerator.h index d1b9be478..d61332a20 100644 --- a/py/objgenerator.h +++ b/py/objgenerator.h @@ -23,12 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJGENERATOR_H__ -#define __MICROPY_INCLUDED_PY_OBJGENERATOR_H__ +#ifndef MICROPY_INCLUDED_PY_OBJGENERATOR_H +#define MICROPY_INCLUDED_PY_OBJGENERATOR_H #include "py/obj.h" #include "py/runtime.h" mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_val, mp_obj_t throw_val, mp_obj_t *ret_val); -#endif // __MICROPY_INCLUDED_PY_OBJGENERATOR_H__ +#endif // MICROPY_INCLUDED_PY_OBJGENERATOR_H diff --git a/py/objint.h b/py/objint.h index da56c1862..f341306ed 100644 --- a/py/objint.h +++ b/py/objint.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJINT_H__ -#define __MICROPY_INCLUDED_PY_OBJINT_H__ +#ifndef MICROPY_INCLUDED_PY_OBJINT_H +#define MICROPY_INCLUDED_PY_OBJINT_H #include "py/mpz.h" #include "py/obj.h" @@ -63,4 +63,4 @@ mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in); mp_obj_t mp_obj_int_binary_op_extra_cases(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in); mp_obj_t mp_obj_int_pow3(mp_obj_t base, mp_obj_t exponent, mp_obj_t modulus); -#endif // __MICROPY_INCLUDED_PY_OBJINT_H__ +#endif // MICROPY_INCLUDED_PY_OBJINT_H diff --git a/py/objlist.h b/py/objlist.h index 5b2d216fc..740ba9fda 100644 --- a/py/objlist.h +++ b/py/objlist.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJLIST_H__ -#define __MICROPY_INCLUDED_PY_OBJLIST_H__ +#ifndef MICROPY_INCLUDED_PY_OBJLIST_H +#define MICROPY_INCLUDED_PY_OBJLIST_H #include "py/obj.h" @@ -35,4 +35,4 @@ typedef struct _mp_obj_list_t { mp_obj_t *items; } mp_obj_list_t; -#endif // __MICROPY_INCLUDED_PY_OBJLIST_H__ +#endif // MICROPY_INCLUDED_PY_OBJLIST_H diff --git a/py/objmodule.h b/py/objmodule.h index 4e6612adc..5bfbe51d5 100644 --- a/py/objmodule.h +++ b/py/objmodule.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJMODULE_H__ -#define __MICROPY_INCLUDED_PY_OBJMODULE_H__ +#ifndef MICROPY_INCLUDED_PY_OBJMODULE_H +#define MICROPY_INCLUDED_PY_OBJMODULE_H #include "py/obj.h" @@ -34,4 +34,4 @@ extern const mp_map_t mp_builtin_module_weak_links_map; mp_obj_t mp_module_get(qstr module_name); void mp_module_register(qstr qstr, mp_obj_t module); -#endif // __MICROPY_INCLUDED_PY_OBJMODULE_H__ +#endif // MICROPY_INCLUDED_PY_OBJMODULE_H diff --git a/py/objstr.h b/py/objstr.h index e92832d10..6fbed405a 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJSTR_H__ -#define __MICROPY_INCLUDED_PY_OBJSTR_H__ +#ifndef MICROPY_INCLUDED_PY_OBJSTR_H +#define MICROPY_INCLUDED_PY_OBJSTR_H #include "py/obj.h" @@ -102,4 +102,4 @@ MP_DECLARE_CONST_FUN_OBJ_1(str_isdigit_obj); MP_DECLARE_CONST_FUN_OBJ_1(str_isupper_obj); MP_DECLARE_CONST_FUN_OBJ_1(str_islower_obj); -#endif // __MICROPY_INCLUDED_PY_OBJSTR_H__ +#endif // MICROPY_INCLUDED_PY_OBJSTR_H diff --git a/py/objtuple.h b/py/objtuple.h index 555c3b3c2..686702395 100644 --- a/py/objtuple.h +++ b/py/objtuple.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJTUPLE_H__ -#define __MICROPY_INCLUDED_PY_OBJTUPLE_H__ +#ifndef MICROPY_INCLUDED_PY_OBJTUPLE_H +#define MICROPY_INCLUDED_PY_OBJTUPLE_H #include "py/obj.h" @@ -61,4 +61,4 @@ void mp_obj_attrtuple_print_helper(const mp_print_t *print, const qstr *fields, mp_obj_t mp_obj_new_attrtuple(const qstr *fields, size_t n, const mp_obj_t *items); -#endif // __MICROPY_INCLUDED_PY_OBJTUPLE_H__ +#endif // MICROPY_INCLUDED_PY_OBJTUPLE_H diff --git a/py/objtype.h b/py/objtype.h index 61efd00c0..104b20aab 100644 --- a/py/objtype.h +++ b/py/objtype.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_OBJTYPE_H__ -#define __MICROPY_INCLUDED_PY_OBJTYPE_H__ +#ifndef MICROPY_INCLUDED_PY_OBJTYPE_H +#define MICROPY_INCLUDED_PY_OBJTYPE_H #include "py/obj.h" @@ -49,4 +49,4 @@ mp_obj_t mp_obj_instance_call(mp_obj_t self_in, size_t n_args, size_t n_kw, cons // this needs to be exposed for the above macros to work correctly mp_obj_t mp_obj_instance_make_new(const mp_obj_type_t *self_in, size_t n_args, size_t n_kw, const mp_obj_t *args); -#endif // __MICROPY_INCLUDED_PY_OBJTYPE_H__ +#endif // MICROPY_INCLUDED_PY_OBJTYPE_H diff --git a/py/parse.h b/py/parse.h index 769f5a875..fec18825b 100644 --- a/py/parse.h +++ b/py/parse.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_PARSE_H__ -#define __MICROPY_INCLUDED_PY_PARSE_H__ +#ifndef MICROPY_INCLUDED_PY_PARSE_H +#define MICROPY_INCLUDED_PY_PARSE_H #include #include @@ -104,4 +104,4 @@ typedef struct _mp_parse_t { mp_parse_tree_t mp_parse(struct _mp_lexer_t *lex, mp_parse_input_kind_t input_kind); void mp_parse_tree_clear(mp_parse_tree_t *tree); -#endif // __MICROPY_INCLUDED_PY_PARSE_H__ +#endif // MICROPY_INCLUDED_PY_PARSE_H diff --git a/py/parsenum.h b/py/parsenum.h index f140cfc85..77fd0f4a5 100644 --- a/py/parsenum.h +++ b/py/parsenum.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_PARSENUM_H__ -#define __MICROPY_INCLUDED_PY_PARSENUM_H__ +#ifndef MICROPY_INCLUDED_PY_PARSENUM_H +#define MICROPY_INCLUDED_PY_PARSENUM_H #include "py/mpconfig.h" #include "py/lexer.h" @@ -34,4 +34,4 @@ mp_obj_t mp_parse_num_integer(const char *restrict str, size_t len, int base, mp_lexer_t *lex); mp_obj_t mp_parse_num_decimal(const char *str, size_t len, bool allow_imag, bool force_complex, mp_lexer_t *lex); -#endif // __MICROPY_INCLUDED_PY_PARSENUM_H__ +#endif // MICROPY_INCLUDED_PY_PARSENUM_H diff --git a/py/parsenumbase.h b/py/parsenumbase.h index 9da9db841..143796df4 100644 --- a/py/parsenumbase.h +++ b/py/parsenumbase.h @@ -23,11 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_PARSENUMBASE_H__ -#define __MICROPY_INCLUDED_PY_PARSENUMBASE_H__ +#ifndef MICROPY_INCLUDED_PY_PARSENUMBASE_H +#define MICROPY_INCLUDED_PY_PARSENUMBASE_H #include "py/mpconfig.h" size_t mp_parse_num_base(const char *str, size_t len, int *base); -#endif // __MICROPY_INCLUDED_PY_PARSENUMBASE_H__ +#endif // MICROPY_INCLUDED_PY_PARSENUMBASE_H diff --git a/py/qstr.h b/py/qstr.h index 8c63fbbc8..4116eb81d 100644 --- a/py/qstr.h +++ b/py/qstr.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_QSTR_H__ -#define __MICROPY_INCLUDED_PY_QSTR_H__ +#ifndef MICROPY_INCLUDED_PY_QSTR_H +#define MICROPY_INCLUDED_PY_QSTR_H #include "py/mpconfig.h" #include "py/misc.h" @@ -76,4 +76,4 @@ const byte *qstr_data(qstr q, size_t *len); void qstr_pool_info(size_t *n_pool, size_t *n_qstr, size_t *n_str_data_bytes, size_t *n_total_bytes); void qstr_dump_data(void); -#endif // __MICROPY_INCLUDED_PY_QSTR_H__ +#endif // MICROPY_INCLUDED_PY_QSTR_H diff --git a/py/repl.h b/py/repl.h index 048b0de0f..c2499a270 100644 --- a/py/repl.h +++ b/py/repl.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_REPL_H__ -#define __MICROPY_INCLUDED_PY_REPL_H__ +#ifndef MICROPY_INCLUDED_PY_REPL_H +#define MICROPY_INCLUDED_PY_REPL_H #include "py/mpconfig.h" #include "py/misc.h" @@ -35,4 +35,4 @@ bool mp_repl_continue_with_input(const char *input); size_t mp_repl_autocomplete(const char *str, size_t len, const mp_print_t *print, const char **compl_str); #endif -#endif // __MICROPY_INCLUDED_PY_REPL_H__ +#endif // MICROPY_INCLUDED_PY_REPL_H diff --git a/py/ringbuf.h b/py/ringbuf.h index 5e108afad..b41692706 100644 --- a/py/ringbuf.h +++ b/py/ringbuf.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_RINGBUF_H__ -#define __MICROPY_INCLUDED_PY_RINGBUF_H__ +#ifndef MICROPY_INCLUDED_PY_RINGBUF_H +#define MICROPY_INCLUDED_PY_RINGBUF_H typedef struct _ringbuf_t { uint8_t *buf; @@ -69,4 +69,4 @@ static inline int ringbuf_put(ringbuf_t *r, uint8_t v) { return 0; } -#endif // __MICROPY_INCLUDED_PY_RINGBUF_H__ +#endif // MICROPY_INCLUDED_PY_RINGBUF_H diff --git a/py/runtime.h b/py/runtime.h index d75d23ff1..0add564cc 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_RUNTIME_H__ -#define __MICROPY_INCLUDED_PY_RUNTIME_H__ +#ifndef MICROPY_INCLUDED_PY_RUNTIME_H +#define MICROPY_INCLUDED_PY_RUNTIME_H #include "py/mpstate.h" #include "py/obj.h" @@ -178,4 +178,4 @@ void mp_warning(const char *msg, ...); #define mp_warning(msg, ...) #endif -#endif // __MICROPY_INCLUDED_PY_RUNTIME_H__ +#endif // MICROPY_INCLUDED_PY_RUNTIME_H diff --git a/py/runtime0.h b/py/runtime0.h index 720fe6a23..060ee8c0a 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_RUNTIME0_H__ -#define __MICROPY_INCLUDED_PY_RUNTIME0_H__ +#ifndef MICROPY_INCLUDED_PY_RUNTIME0_H +#define MICROPY_INCLUDED_PY_RUNTIME0_H // These must fit in 8 bits; see scope.h #define MP_SCOPE_FLAG_VARARGS (0x01) @@ -151,4 +151,4 @@ typedef enum { extern void *const mp_fun_table[MP_F_NUMBER_OF]; -#endif // __MICROPY_INCLUDED_PY_RUNTIME0_H__ +#endif // MICROPY_INCLUDED_PY_RUNTIME0_H diff --git a/py/scope.h b/py/scope.h index 826064d7e..4d0c1b1d9 100644 --- a/py/scope.h +++ b/py/scope.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_SCOPE_H__ -#define __MICROPY_INCLUDED_PY_SCOPE_H__ +#ifndef MICROPY_INCLUDED_PY_SCOPE_H +#define MICROPY_INCLUDED_PY_SCOPE_H #include "py/parse.h" #include "py/emitglue.h" @@ -94,4 +94,4 @@ id_info_t *scope_find(scope_t *scope, qstr qstr); id_info_t *scope_find_global(scope_t *scope, qstr qstr); void scope_find_local_and_close_over(scope_t *scope, id_info_t *id, qstr qst); -#endif // __MICROPY_INCLUDED_PY_SCOPE_H__ +#endif // MICROPY_INCLUDED_PY_SCOPE_H diff --git a/py/smallint.h b/py/smallint.h index b9686be30..b2bfc6df9 100644 --- a/py/smallint.h +++ b/py/smallint.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_SMALLINT_H__ -#define __MICROPY_INCLUDED_PY_SMALLINT_H__ +#ifndef MICROPY_INCLUDED_PY_SMALLINT_H +#define MICROPY_INCLUDED_PY_SMALLINT_H #include "py/mpconfig.h" #include "py/misc.h" @@ -65,4 +65,4 @@ bool mp_small_int_mul_overflow(mp_int_t x, mp_int_t y); mp_int_t mp_small_int_modulo(mp_int_t dividend, mp_int_t divisor); mp_int_t mp_small_int_floor_divide(mp_int_t num, mp_int_t denom); -#endif // __MICROPY_INCLUDED_PY_SMALLINT_H__ +#endif // MICROPY_INCLUDED_PY_SMALLINT_H diff --git a/py/stackctrl.h b/py/stackctrl.h index e915f5000..84c0e1427 100644 --- a/py/stackctrl.h +++ b/py/stackctrl.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_STACKCTRL_H__ -#define __MICROPY_INCLUDED_PY_STACKCTRL_H__ +#ifndef MICROPY_INCLUDED_PY_STACKCTRL_H +#define MICROPY_INCLUDED_PY_STACKCTRL_H #include "py/mpconfig.h" @@ -45,4 +45,4 @@ void mp_stack_check(void); #endif -#endif // __MICROPY_INCLUDED_PY_STACKCTRL_H__ +#endif // MICROPY_INCLUDED_PY_STACKCTRL_H diff --git a/py/stream.h b/py/stream.h index 01199ab60..0b5fd7cc0 100644 --- a/py/stream.h +++ b/py/stream.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_STREAM_H__ -#define __MICROPY_INCLUDED_PY_STREAM_H__ +#ifndef MICROPY_INCLUDED_PY_STREAM_H +#define MICROPY_INCLUDED_PY_STREAM_H #include "py/obj.h" #include "py/mperrno.h" @@ -103,4 +103,4 @@ int mp_stream_posix_fsync(mp_obj_t stream); #define mp_is_nonblocking_error(errno) (0) #endif -#endif // __MICROPY_INCLUDED_PY_STREAM_H__ +#endif // MICROPY_INCLUDED_PY_STREAM_H diff --git a/py/unicode.h b/py/unicode.h index 89c28ed0e..f99c9705d 100644 --- a/py/unicode.h +++ b/py/unicode.h @@ -23,12 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_PY_UNICODE_H__ -#define __MICROPY_INCLUDED_PY_UNICODE_H__ +#ifndef MICROPY_INCLUDED_PY_UNICODE_H +#define MICROPY_INCLUDED_PY_UNICODE_H #include "py/mpconfig.h" #include "py/misc.h" mp_uint_t utf8_ptr_to_index(const byte *s, const byte *ptr); -#endif // __MICROPY_INCLUDED_PY_UNICODE_H__ +#endif // MICROPY_INCLUDED_PY_UNICODE_H diff --git a/stmhal/accel.h b/stmhal/accel.h index 10b095f79..42b156329 100644 --- a/stmhal/accel.h +++ b/stmhal/accel.h @@ -23,7 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_ACCEL_H +#define MICROPY_INCLUDED_STMHAL_ACCEL_H extern const mp_obj_type_t pyb_accel_type; void accel_init(void); + +#endif // MICROPY_INCLUDED_STMHAL_ACCEL_H diff --git a/stmhal/adc.h b/stmhal/adc.h index ebaccbee3..6ec558464 100644 --- a/stmhal/adc.h +++ b/stmhal/adc.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_ADC_H +#define MICROPY_INCLUDED_STMHAL_ADC_H extern const mp_obj_type_t pyb_adc_type; extern const mp_obj_type_t pyb_adc_all_type; + +#endif // MICROPY_INCLUDED_STMHAL_ADC_H diff --git a/stmhal/bufhelper.h b/stmhal/bufhelper.h index abdeea6a8..55f57be8e 100644 --- a/stmhal/bufhelper.h +++ b/stmhal/bufhelper.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_BUFHELPER_H +#define MICROPY_INCLUDED_STMHAL_BUFHELPER_H void pyb_buf_get_for_send(mp_obj_t o, mp_buffer_info_t *bufinfo, byte *tmp_data); mp_obj_t pyb_buf_get_for_recv(mp_obj_t o, vstr_t *vstr); + +#endif // MICROPY_INCLUDED_STMHAL_BUFHELPER_H diff --git a/stmhal/can.h b/stmhal/can.h index 4d4b1bb83..7c40e9bf9 100644 --- a/stmhal/can.h +++ b/stmhal/can.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_CAN_H +#define MICROPY_INCLUDED_STMHAL_CAN_H #define PYB_CAN_1 (1) #define PYB_CAN_2 (2) @@ -32,3 +34,5 @@ extern const mp_obj_type_t pyb_can_type; void can_init0(void); void can_deinit(void); void can_rx_irq_handler(uint can_id, uint fifo_id); + +#endif // MICROPY_INCLUDED_STMHAL_CAN_H diff --git a/stmhal/dac.h b/stmhal/dac.h index ba44158f3..93192c0fe 100644 --- a/stmhal/dac.h +++ b/stmhal/dac.h @@ -23,7 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_DAC_H +#define MICROPY_INCLUDED_STMHAL_DAC_H void dac_init(void); extern const mp_obj_type_t pyb_dac_type; + +#endif // MICROPY_INCLUDED_STMHAL_DAC_H diff --git a/stmhal/dma.h b/stmhal/dma.h index 57b8f866d..d8b11ca3a 100644 --- a/stmhal/dma.h +++ b/stmhal/dma.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_STMHAL_DMA_H__ -#define __MICROPY_INCLUDED_STMHAL_DMA_H__ +#ifndef MICROPY_INCLUDED_STMHAL_DMA_H +#define MICROPY_INCLUDED_STMHAL_DMA_H typedef struct _dma_descr_t dma_descr_t; @@ -101,4 +100,4 @@ void dma_deinit(const dma_descr_t *dma_descr); void dma_invalidate_channel(const dma_descr_t *dma_descr); void dma_idle_handler(int controller); -#endif //__MICROPY_INCLUDED_STMHAL_DMA_H__ +#endif // MICROPY_INCLUDED_STMHAL_DMA_H diff --git a/stmhal/extint.h b/stmhal/extint.h index b04224c40..0eae8942c 100644 --- a/stmhal/extint.h +++ b/stmhal/extint.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_EXTINT_H +#define MICROPY_INCLUDED_STMHAL_EXTINT_H // Vectors 0-15 are for regular pins // Vectors 16-22 are for internal sources. @@ -61,3 +63,5 @@ void extint_swint(uint line); void Handle_EXTI_Irq(uint32_t line); extern const mp_obj_type_t extint_type; + +#endif // MICROPY_INCLUDED_STMHAL_EXTINT_H diff --git a/stmhal/flash.h b/stmhal/flash.h index 007155ecb..c5b5bf352 100644 --- a/stmhal/flash.h +++ b/stmhal/flash.h @@ -23,7 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_FLASH_H +#define MICROPY_INCLUDED_STMHAL_FLASH_H uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *size); void flash_erase(uint32_t flash_dest, const uint32_t *src, uint32_t num_word32); void flash_write(uint32_t flash_dest, const uint32_t *src, uint32_t num_word32); + +#endif // MICROPY_INCLUDED_STMHAL_FLASH_H diff --git a/stmhal/font_petme128_8x8.h b/stmhal/font_petme128_8x8.h index 7f928edda..f27277760 100644 --- a/stmhal/font_petme128_8x8.h +++ b/stmhal/font_petme128_8x8.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_FONT_PETME128_8X8_H +#define MICROPY_INCLUDED_STMHAL_FONT_PETME128_8X8_H static const uint8_t font_petme128_8x8[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 32= @@ -122,3 +124,5 @@ static const uint8_t font_petme128_8x8[] = { 0x00,0x02,0x03,0x01,0x03,0x02,0x03,0x01, // 126=~ 0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55, // 127 }; + +#endif // MICROPY_INCLUDED_STMHAL_FONT_PETME128_8X8_H diff --git a/stmhal/gccollect.h b/stmhal/gccollect.h index 07797be7e..2cb32a8d4 100644 --- a/stmhal/gccollect.h +++ b/stmhal/gccollect.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_GCCOLLECT_H +#define MICROPY_INCLUDED_STMHAL_GCCOLLECT_H // variables defining memory layout // (these probably belong somewhere else...) @@ -37,3 +39,5 @@ extern uint32_t _heap_start; extern uint32_t _heap_end; extern uint32_t _estack; extern uint32_t _ram_end; + +#endif // MICROPY_INCLUDED_STMHAL_GCCOLLECT_H diff --git a/stmhal/i2c.h b/stmhal/i2c.h index fc7a6f613..eda076e82 100644 --- a/stmhal/i2c.h +++ b/stmhal/i2c.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_I2C_H +#define MICROPY_INCLUDED_STMHAL_I2C_H #include "dma.h" @@ -49,3 +51,5 @@ void i2c_init_freq(const pyb_i2c_obj_t *self, mp_int_t freq); uint32_t i2c_get_baudrate(I2C_InitTypeDef *init); void i2c_ev_irq_handler(mp_uint_t i2c_id); void i2c_er_irq_handler(mp_uint_t i2c_id); + +#endif // MICROPY_INCLUDED_STMHAL_I2C_H diff --git a/stmhal/irq.h b/stmhal/irq.h index 35187520a..8d44b50ed 100644 --- a/stmhal/irq.h +++ b/stmhal/irq.h @@ -23,7 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #ifndef MICROPY_INCLUDED_STMHAL_IRQ_H #define MICROPY_INCLUDED_STMHAL_IRQ_H diff --git a/stmhal/lcd.h b/stmhal/lcd.h index 6a4b004bd..be4f6ed25 100644 --- a/stmhal/lcd.h +++ b/stmhal/lcd.h @@ -23,5 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_LCD_H +#define MICROPY_INCLUDED_STMHAL_LCD_H extern const mp_obj_type_t pyb_lcd_type; + +#endif // MICROPY_INCLUDED_STMHAL_LCD_H diff --git a/stmhal/led.h b/stmhal/led.h index f4cd67336..fc9348181 100644 --- a/stmhal/led.h +++ b/stmhal/led.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_LED_H +#define MICROPY_INCLUDED_STMHAL_LED_H typedef enum { // PYBv3 @@ -48,3 +50,5 @@ void led_toggle(pyb_led_t led); void led_debug(int value, int delay); extern const mp_obj_type_t pyb_led_type; + +#endif // MICROPY_INCLUDED_STMHAL_LED_H diff --git a/stmhal/modmachine.h b/stmhal/modmachine.h index 164c5cfda..ac39f854e 100644 --- a/stmhal/modmachine.h +++ b/stmhal/modmachine.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_STMHAL_MODMACHINE_H__ -#define __MICROPY_INCLUDED_STMHAL_MODMACHINE_H__ +#ifndef MICROPY_INCLUDED_STMHAL_MODMACHINE_H +#define MICROPY_INCLUDED_STMHAL_MODMACHINE_H #include "py/mpstate.h" #include "py/nlr.h" @@ -41,4 +40,4 @@ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_freq_obj); MP_DECLARE_CONST_FUN_OBJ_0(machine_sleep_obj); MP_DECLARE_CONST_FUN_OBJ_0(machine_deepsleep_obj); -#endif // __MICROPY_INCLUDED_STMHAL_MODMACHINE_H__ +#endif // MICROPY_INCLUDED_STMHAL_MODMACHINE_H diff --git a/stmhal/modnetwork.h b/stmhal/modnetwork.h index d3bc5674d..83e4255d5 100644 --- a/stmhal/modnetwork.h +++ b/stmhal/modnetwork.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_MODNETWORK_H +#define MICROPY_INCLUDED_STMHAL_MODNETWORK_H #define MOD_NETWORK_IPADDR_BUF_SIZE (4) @@ -77,3 +79,5 @@ extern const mod_network_nic_type_t mod_network_nic_type_cc3k; void mod_network_init(void); void mod_network_register_nic(mp_obj_t nic); mp_obj_t mod_network_find_nic(const uint8_t *ip); + +#endif // MICROPY_INCLUDED_STMHAL_MODNETWORK_H diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h index d3ce11e02..a8ea2f02a 100644 --- a/stmhal/mpconfigport.h +++ b/stmhal/mpconfigport.h @@ -27,10 +27,6 @@ // Options to control how MicroPython is built for this port, // overriding defaults in py/mpconfig.h. -#pragma once -#ifndef __INCLUDED_MPCONFIGPORT_H -#define __INCLUDED_MPCONFIGPORT_H - // board specific definitions #include "mpconfigboard.h" @@ -350,5 +346,3 @@ static inline mp_uint_t disable_irq(void) { #include #define MICROPY_PIN_DEFS_PORT_H "pin_defs_stmhal.h" - -#endif // __INCLUDED_MPCONFIGPORT_H diff --git a/stmhal/mpthreadport.h b/stmhal/mpthreadport.h index 3d8b4ef01..8e2372dcb 100644 --- a/stmhal/mpthreadport.h +++ b/stmhal/mpthreadport.h @@ -23,8 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_STMHAL_MPTHREADPORT_H__ -#define __MICROPY_INCLUDED_STMHAL_MPTHREADPORT_H__ #include "py/mpthread.h" #include "pybthread.h" @@ -53,5 +51,3 @@ static inline int mp_thread_mutex_lock(mp_thread_mutex_t *m, int wait) { static inline void mp_thread_mutex_unlock(mp_thread_mutex_t *m) { pyb_mutex_unlock(m); } - -#endif // __MICROPY_INCLUDED_STMHAL_MPTHREADPORT_H__ diff --git a/stmhal/pendsv.h b/stmhal/pendsv.h index 77c78d4c1..b64e61386 100644 --- a/stmhal/pendsv.h +++ b/stmhal/pendsv.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_PENDSV_H +#define MICROPY_INCLUDED_STMHAL_PENDSV_H void pendsv_init(void); void pendsv_kbd_intr(void); @@ -30,3 +32,5 @@ void pendsv_kbd_intr(void); // since we play tricks with the stack, the compiler must not generate a // prelude for this function void pendsv_isr_handler(void) __attribute__((naked)); + +#endif // MICROPY_INCLUDED_STMHAL_PENDSV_H diff --git a/stmhal/pin.h b/stmhal/pin.h index a11b0a0f8..1ec4bd6b8 100644 --- a/stmhal/pin.h +++ b/stmhal/pin.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_STMHAL_PIN_H__ -#define __MICROPY_INCLUDED_STMHAL_PIN_H__ +#ifndef MICROPY_INCLUDED_STMHAL_PIN_H +#define MICROPY_INCLUDED_STMHAL_PIN_H // This file requires pin_defs_xxx.h (which has port specific enums and // defines, so we include it here. It should never be included directly @@ -98,4 +97,4 @@ const pin_af_obj_t *pin_find_af(const pin_obj_t *pin, uint8_t fn, uint8_t unit); const pin_af_obj_t *pin_find_af_by_index(const pin_obj_t *pin, mp_uint_t af_idx); const pin_af_obj_t *pin_find_af_by_name(const pin_obj_t *pin, const char *name); -#endif // __MICROPY_INCLUDED_STMHAL_PIN_H__ +#endif // MICROPY_INCLUDED_STMHAL_PIN_H diff --git a/stmhal/portmodules.h b/stmhal/portmodules.h index 0b460f38c..4e892da96 100644 --- a/stmhal/portmodules.h +++ b/stmhal/portmodules.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_PORTMODULES_H +#define MICROPY_INCLUDED_STMHAL_PORTMODULES_H extern const mp_obj_module_t pyb_module; extern const mp_obj_module_t stm_module; @@ -37,3 +39,5 @@ MP_DECLARE_CONST_FUN_OBJ_1(time_sleep_us_obj); MP_DECLARE_CONST_FUN_OBJ_0(mod_os_sync_obj); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mod_os_dupterm_obj); + +#endif // MICROPY_INCLUDED_STMHAL_PORTMODULES_H diff --git a/stmhal/pybthread.h b/stmhal/pybthread.h index 6edb2400e..f628f934b 100644 --- a/stmhal/pybthread.h +++ b/stmhal/pybthread.h @@ -23,7 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - #ifndef MICROPY_INCLUDED_STMHAL_PYBTHREAD_H #define MICROPY_INCLUDED_STMHAL_PYBTHREAD_H diff --git a/stmhal/rng.h b/stmhal/rng.h index ce1833e80..f022f3a67 100644 --- a/stmhal/rng.h +++ b/stmhal/rng.h @@ -23,8 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_RNG_H +#define MICROPY_INCLUDED_STMHAL_RNG_H void rng_init0(void); uint32_t rng_get(void); MP_DECLARE_CONST_FUN_OBJ_0(pyb_rng_get_obj); + +#endif // MICROPY_INCLUDED_STMHAL_RNG_H diff --git a/stmhal/rtc.h b/stmhal/rtc.h index 69d64c778..f382fa6b6 100644 --- a/stmhal/rtc.h +++ b/stmhal/rtc.h @@ -23,9 +23,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_RTC_H +#define MICROPY_INCLUDED_STMHAL_RTC_H extern RTC_HandleTypeDef RTCHandle; extern const mp_obj_type_t pyb_rtc_type; void rtc_init_start(bool force_init); void rtc_init_finalise(void); + +#endif // MICROPY_INCLUDED_STMHAL_RTC_H diff --git a/stmhal/sdcard.h b/stmhal/sdcard.h index 237e48d8b..d595f0f1a 100644 --- a/stmhal/sdcard.h +++ b/stmhal/sdcard.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_SDCARD_H +#define MICROPY_INCLUDED_STMHAL_SDCARD_H // this is a fixed size and should not be changed #define SDCARD_BLOCK_SIZE (512) @@ -42,3 +44,5 @@ extern const struct _mp_obj_base_t pyb_sdcard_obj; struct _fs_user_mount_t; void sdcard_init_vfs(struct _fs_user_mount_t *vfs, int part); + +#endif // MICROPY_INCLUDED_STMHAL_SDCARD_H diff --git a/stmhal/servo.h b/stmhal/servo.h index 0fca8fea1..18fd493d5 100644 --- a/stmhal/servo.h +++ b/stmhal/servo.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_SERVO_H +#define MICROPY_INCLUDED_STMHAL_SERVO_H void servo_init(void); void servo_timer_irq_callback(void); @@ -31,3 +33,5 @@ extern const mp_obj_type_t pyb_servo_type; MP_DECLARE_CONST_FUN_OBJ_2(pyb_servo_set_obj); MP_DECLARE_CONST_FUN_OBJ_2(pyb_pwm_set_obj); + +#endif // MICROPY_INCLUDED_STMHAL_SERVO_H diff --git a/stmhal/spi.h b/stmhal/spi.h index 5686bde64..e6752fdd1 100644 --- a/stmhal/spi.h +++ b/stmhal/spi.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_SPI_H +#define MICROPY_INCLUDED_STMHAL_SPI_H extern SPI_HandleTypeDef SPIHandle1; extern SPI_HandleTypeDef SPIHandle2; @@ -37,3 +39,5 @@ extern const mp_obj_type_t machine_hard_spi_type; void spi_init0(void); void spi_init(SPI_HandleTypeDef *spi, bool enable_nss_pin); SPI_HandleTypeDef *spi_get_handle(mp_obj_t o); + +#endif // MICROPY_INCLUDED_STMHAL_SPI_H diff --git a/stmhal/stm32_it.h b/stmhal/stm32_it.h index a168cda83..d6ed1b2b9 100644 --- a/stmhal/stm32_it.h +++ b/stmhal/stm32_it.h @@ -25,6 +25,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_STM32_IT_H +#define MICROPY_INCLUDED_STMHAL_STM32_IT_H /** ****************************************************************************** @@ -80,3 +82,5 @@ void OTG_FS_IRQHandler(void); #ifdef USE_USB_HS void OTG_HS_IRQHandler(void); #endif + +#endif // MICROPY_INCLUDED_STMHAL_STM32_IT_H diff --git a/stmhal/storage.h b/stmhal/storage.h index 4d3de77ed..0ecb5715a 100644 --- a/stmhal/storage.h +++ b/stmhal/storage.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_STORAGE_H +#define MICROPY_INCLUDED_STMHAL_STORAGE_H #define FLASH_BLOCK_SIZE (512) @@ -45,3 +47,5 @@ extern const struct _mp_obj_type_t pyb_flash_type; struct _fs_user_mount_t; void pyb_flash_init_vfs(struct _fs_user_mount_t *vfs); + +#endif // MICROPY_INCLUDED_STMHAL_STORAGE_H diff --git a/stmhal/systick.h b/stmhal/systick.h index 1e7f62335..524afae40 100644 --- a/stmhal/systick.h +++ b/stmhal/systick.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_SYSTICK_H +#define MICROPY_INCLUDED_STMHAL_SYSTICK_H void sys_tick_wait_at_least(uint32_t stc, uint32_t delay_ms); bool sys_tick_has_passed(uint32_t stc, uint32_t delay_ms); + +#endif // MICROPY_INCLUDED_STMHAL_SYSTICK_H diff --git a/stmhal/timer.h b/stmhal/timer.h index a18d7cf10..72e461f2f 100644 --- a/stmhal/timer.h +++ b/stmhal/timer.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_TIMER_H +#define MICROPY_INCLUDED_STMHAL_TIMER_H extern TIM_HandleTypeDef TIM5_Handle; @@ -36,3 +38,5 @@ uint32_t timer_get_source_freq(uint32_t tim_id); void timer_irq_handler(uint tim_id); TIM_HandleTypeDef *pyb_timer_get_handle(mp_obj_t timer); + +#endif // MICROPY_INCLUDED_STMHAL_TIMER_H diff --git a/stmhal/uart.h b/stmhal/uart.h index 7fdc59de7..749530954 100644 --- a/stmhal/uart.h +++ b/stmhal/uart.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_UART_H +#define MICROPY_INCLUDED_STMHAL_UART_H typedef enum { PYB_UART_NONE = 0, @@ -47,3 +49,5 @@ mp_uint_t uart_rx_any(pyb_uart_obj_t *uart_obj); int uart_rx_char(pyb_uart_obj_t *uart_obj); void uart_tx_strn(pyb_uart_obj_t *uart_obj, const char *str, uint len); void uart_tx_strn_cooked(pyb_uart_obj_t *uart_obj, const char *str, uint len); + +#endif // MICROPY_INCLUDED_STMHAL_UART_H diff --git a/stmhal/usb.h b/stmhal/usb.h index 42e6c76f8..e04fe70d7 100644 --- a/stmhal/usb.h +++ b/stmhal/usb.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_USB_H +#define MICROPY_INCLUDED_STMHAL_USB_H #include "usbd_cdc_msc_hid0.h" @@ -67,3 +69,5 @@ void usb_vcp_send_strn_cooked(const char *str, int len); void pyb_usb_host_init(void); void pyb_usb_host_process(void); uint pyb_usb_host_get_keyboard(void); + +#endif // MICROPY_INCLUDED_STMHAL_USB_H diff --git a/stmhal/usbd_cdc_interface.h b/stmhal/usbd_cdc_interface.h index d96861a7e..6f9a1e8a3 100644 --- a/stmhal/usbd_cdc_interface.h +++ b/stmhal/usbd_cdc_interface.h @@ -1,6 +1,8 @@ /* * This file is part of the Micro Python project, http://micropython.org/ */ +#ifndef MICROPY_INCLUDED_STMHAL_USBD_CDC_INTERFACE_H +#define MICROPY_INCLUDED_STMHAL_USBD_CDC_INTERFACE_H /** ****************************************************************************** @@ -39,3 +41,5 @@ void USBD_CDC_TxAlways(const uint8_t *buf, uint32_t len); int USBD_CDC_RxNum(void); int USBD_CDC_Rx(uint8_t *buf, uint32_t len, uint32_t timeout); + +#endif // MICROPY_INCLUDED_STMHAL_USBD_CDC_INTERFACE_H diff --git a/stmhal/usbd_desc.h b/stmhal/usbd_desc.h index 93e222fc9..f48e364e1 100644 --- a/stmhal/usbd_desc.h +++ b/stmhal/usbd_desc.h @@ -23,7 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_USBD_DESC_H +#define MICROPY_INCLUDED_STMHAL_USBD_DESC_H extern const USBD_DescriptorsTypeDef USBD_Descriptors; void USBD_SetVIDPIDRelease(uint16_t vid, uint16_t pid, uint16_t device_release_num, int cdc_only); + +#endif // MICROPY_INCLUDED_STMHAL_USBD_DESC_H diff --git a/stmhal/usbd_hid_interface.h b/stmhal/usbd_hid_interface.h index fbc874796..b2ff75fa1 100644 --- a/stmhal/usbd_hid_interface.h +++ b/stmhal/usbd_hid_interface.h @@ -1,6 +1,8 @@ /* * This file is part of the MicroPython project, http://micropython.org/ */ +#ifndef MICROPY_INCLUDED_STMHAL_USBD_HID_INTERFACE_H +#define MICROPY_INCLUDED_STMHAL_USBD_HID_INTERFACE_H #include "usbd_cdc_msc_hid.h" @@ -8,3 +10,5 @@ extern const USBD_HID_ItfTypeDef USBD_HID_fops; int USBD_HID_RxNum(void); int USBD_HID_Rx(USBD_HandleTypeDef *pdev, uint8_t *buf, uint32_t len, uint32_t timeout); + +#endif // MICROPY_INCLUDED_STMHAL_USBD_HID_INTERFACE_H diff --git a/stmhal/usbd_msc_storage.h b/stmhal/usbd_msc_storage.h index 4a0d28ca8..a4bc8004a 100644 --- a/stmhal/usbd_msc_storage.h +++ b/stmhal/usbd_msc_storage.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_USBD_MSC_STORAGE_H +#define MICROPY_INCLUDED_STMHAL_USBD_MSC_STORAGE_H extern const USBD_StorageTypeDef USBD_FLASH_STORAGE_fops; extern const USBD_StorageTypeDef USBD_SDCARD_STORAGE_fops; + +#endif // MICROPY_INCLUDED_STMHAL_USBD_MSC_STORAGE_H diff --git a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h index bc9d0d21a..ec03c860a 100644 --- a/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h +++ b/stmhal/usbdev/class/inc/usbd_cdc_msc_hid0.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_STMHAL_USB_CDC_MSC_HID0_H__ -#define __MICROPY_INCLUDED_STMHAL_USB_CDC_MSC_HID0_H__ +#ifndef MICROPY_INCLUDED_STMHAL_USBDEV_CLASS_INC_USBD_CDC_MSC_HID0_H +#define MICROPY_INCLUDED_STMHAL_USBDEV_CLASS_INC_USBD_CDC_MSC_HID0_H // these are exports for the CDC/MSC/HID interface that are independent // from any other definitions/declarations @@ -49,4 +48,4 @@ typedef struct _USBD_HID_ModeInfoTypeDef { const uint8_t *report_desc; } USBD_HID_ModeInfoTypeDef; -#endif // __MICROPY_INCLUDED_STMHAL_USB_CDC_MSC_HID0_H__ +#endif // MICROPY_INCLUDED_STMHAL_USBDEV_CLASS_INC_USBD_CDC_MSC_HID0_H diff --git a/stmhal/usrsw.h b/stmhal/usrsw.h index b6dff2c43..9fbe6109d 100644 --- a/stmhal/usrsw.h +++ b/stmhal/usrsw.h @@ -23,8 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_USRSW_H +#define MICROPY_INCLUDED_STMHAL_USRSW_H void switch_init0(void); int switch_get(void); extern const mp_obj_type_t pyb_switch_type; + +#endif // MICROPY_INCLUDED_STMHAL_USRSW_H diff --git a/stmhal/wdt.h b/stmhal/wdt.h index 362d6ef68..0a486f704 100644 --- a/stmhal/wdt.h +++ b/stmhal/wdt.h @@ -23,5 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_STMHAL_WDT_H +#define MICROPY_INCLUDED_STMHAL_WDT_H extern const mp_obj_type_t pyb_wdt_type; + +#endif // MICROPY_INCLUDED_STMHAL_WDT_H diff --git a/teensy/hal_ftm.h b/teensy/hal_ftm.h index 3dc15300d..ad627358b 100644 --- a/teensy/hal_ftm.h +++ b/teensy/hal_ftm.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_TEENSY_HAL_FTM_H +#define MICROPY_INCLUDED_TEENSY_HAL_FTM_H #define FTM0 ((FTM_TypeDef *)&FTM0_SC) #define FTM1 ((FTM_TypeDef *)&FTM1_SC) @@ -181,4 +183,4 @@ void HAL_FTM_IC_Start(FTM_HandleTypeDef *hftm, uint32_t channel); void HAL_FTM_IC_Start_IT(FTM_HandleTypeDef *hftm, uint32_t channel); void HAL_FTM_IC_DeInit(FTM_HandleTypeDef *hftm); - +#endif // MICROPY_INCLUDED_TEENSY_HAL_FTM_H diff --git a/teensy/led.h b/teensy/led.h index 7f4ba18f2..5c45166ef 100644 --- a/teensy/led.h +++ b/teensy/led.h @@ -1,3 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_LED_H +#define MICROPY_INCLUDED_TEENSY_LED_H + typedef enum { PYB_LED_BUILTIN = 1, } pyb_led_t; @@ -7,3 +10,5 @@ void led_state(pyb_led_t led, int state); void led_toggle(pyb_led_t led); extern const mp_obj_type_t pyb_led_type; + +#endif // MICROPY_INCLUDED_TEENSY_LED_H diff --git a/teensy/lexermemzip.h b/teensy/lexermemzip.h index e5d4be5ea..cd7326a43 100644 --- a/teensy/lexermemzip.h +++ b/teensy/lexermemzip.h @@ -1,2 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_LEXERMEMZIP_H +#define MICROPY_INCLUDED_TEENSY_LEXERMEMZIP_H + mp_lexer_t *mp_lexer_new_from_memzip_file(const char *filename); +#endif // MICROPY_INCLUDED_TEENSY_LEXERMEMZIP_H diff --git a/teensy/reg.h b/teensy/reg.h index 5d1d27443..0da6378ee 100644 --- a/teensy/reg.h +++ b/teensy/reg.h @@ -1,3 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_REG_H +#define MICROPY_INCLUDED_TEENSY_REG_H + typedef struct { const char *name; mp_uint_t offset; @@ -6,3 +9,5 @@ typedef struct { #define REG_ENTRY(st, name) { #name, offsetof(st, name) } mp_obj_t reg_cmd(void *base, reg_t *reg, mp_uint_t num_reg, uint n_args, const mp_obj_t *args); + +#endif // MICROPY_INCLUDED_TEENSY_REG_H diff --git a/teensy/servo.h b/teensy/servo.h index 5f1c87b69..1ad34353d 100644 --- a/teensy/servo.h +++ b/teensy/servo.h @@ -1,3 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_SERVO_H +#define MICROPY_INCLUDED_TEENSY_SERVO_H + void servo_init(void); extern const mp_obj_type_t pyb_servo_type; @@ -5,3 +8,4 @@ extern const mp_obj_type_t pyb_servo_type; MP_DECLARE_CONST_FUN_OBJ_2(pyb_servo_set_obj); MP_DECLARE_CONST_FUN_OBJ_2(pyb_pwm_set_obj); +#endif // MICROPY_INCLUDED_TEENSY_SERVO_H diff --git a/teensy/std.h b/teensy/std.h index 42791877a..ef55d22dd 100644 --- a/teensy/std.h +++ b/teensy/std.h @@ -1,3 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_STD_H +#define MICROPY_INCLUDED_TEENSY_STD_H + typedef unsigned int size_t; void __assert_func(void); @@ -18,3 +21,5 @@ char *strcat(char *dest, const char *src); int printf(const char *fmt, ...); int snprintf(char *str, size_t size, const char *fmt, ...); + +#endif // MICROPY_INCLUDED_TEENSY_STD_H diff --git a/teensy/timer.h b/teensy/timer.h index bfa7636f4..89095b076 100644 --- a/teensy/timer.h +++ b/teensy/timer.h @@ -23,8 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_TEENSY_TIMER_H +#define MICROPY_INCLUDED_TEENSY_TIMER_H extern const mp_obj_type_t pyb_timer_type; void timer_init0(void); void timer_deinit(void); + +#endif // MICROPY_INCLUDED_TEENSY_TIMER_H diff --git a/teensy/usb.h b/teensy/usb.h index 949d7a59c..50fb3ff90 100644 --- a/teensy/usb.h +++ b/teensy/usb.h @@ -1,3 +1,6 @@ +#ifndef MICROPY_INCLUDED_TEENSY_USB_H +#define MICROPY_INCLUDED_TEENSY_USB_H + bool usb_vcp_is_connected(void); bool usb_vcp_is_enabled(void); int usb_vcp_rx_num(void); @@ -5,3 +8,5 @@ int usb_vcp_recv_byte(uint8_t *ptr); void usb_vcp_send_str(const char* str); void usb_vcp_send_strn(const char* str, int len); void usb_vcp_send_strn_cooked(const char *str, int len); + +#endif // MICROPY_INCLUDED_TEENSY_USB_H diff --git a/unix/fdfile.h b/unix/fdfile.h index 8e8e97c79..591159deb 100644 --- a/unix/fdfile.h +++ b/unix/fdfile.h @@ -24,12 +24,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_UNIX_FDFILE_H +#define MICROPY_INCLUDED_UNIX_FDFILE_H #include "py/obj.h" -#ifndef __MICROPY_INCLUDED_UNIX_FILE_H__ -#define __MICROPY_INCLUDED_UNIX_FILE_H__ - typedef struct _mp_obj_fdfile_t { mp_obj_base_t base; int fd; @@ -38,4 +37,4 @@ typedef struct _mp_obj_fdfile_t { extern const mp_obj_type_t mp_type_fileio; extern const mp_obj_type_t mp_type_textio; -#endif // __MICROPY_INCLUDED_UNIX_FILE_H__ +#endif // MICROPY_INCLUDED_UNIX_FDFILE_H diff --git a/unix/input.h b/unix/input.h index 7cbee33c5..a76b87e64 100644 --- a/unix/input.h +++ b/unix/input.h @@ -1,3 +1,8 @@ +#ifndef MICROPY_INCLUDED_UNIX_INPUT_H +#define MICROPY_INCLUDED_UNIX_INPUT_H + char *prompt(char *p); void prompt_read_history(void); void prompt_write_history(void); + +#endif // MICROPY_INCLUDED_UNIX_INPUT_H diff --git a/unix/mpthreadport.h b/unix/mpthreadport.h index 51cf8d786..b158ed5bc 100644 --- a/unix/mpthreadport.h +++ b/unix/mpthreadport.h @@ -23,8 +23,6 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef __MICROPY_INCLUDED_UNIX_MPTHREADPORT_H__ -#define __MICROPY_INCLUDED_UNIX_MPTHREADPORT_H__ #include @@ -32,5 +30,3 @@ typedef pthread_mutex_t mp_thread_mutex_t; void mp_thread_init(void); void mp_thread_gc_others(void); - -#endif // __MICROPY_INCLUDED_UNIX_MPTHREADPORT_H__ diff --git a/windows/fmode.h b/windows/fmode.h index 23d6d3d54..c661c84d0 100644 --- a/windows/fmode.h +++ b/windows/fmode.h @@ -23,9 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#ifndef __MICROPY_INCLUDED_WINDOWS_FMODE_H__ -#define __MICROPY_INCLUDED_WINDOWS_FMODE_H__ +#ifndef MICROPY_INCLUDED_WINDOWS_FMODE_H +#define MICROPY_INCLUDED_WINDOWS_FMODE_H // Treat files opened by open() as binary. No line ending translation is done. void set_fmode_binary(void); @@ -35,4 +34,4 @@ void set_fmode_binary(void); // When writing to the file \n will be converted into \r\n. void set_fmode_text(void); -#endif +#endif // MICROPY_INCLUDED_WINDOWS_FMODE_H diff --git a/windows/init.h b/windows/init.h index 69e577689..480befef6 100644 --- a/windows/init.h +++ b/windows/init.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_INIT_H +#define MICROPY_INCLUDED_WINDOWS_INIT_H void init(void); void deinit(void); + +#endif // MICROPY_INCLUDED_WINDOWS_INIT_H diff --git a/windows/msvc/dirent.h b/windows/msvc/dirent.h index 6172913ee..fca06785a 100644 --- a/windows/msvc/dirent.h +++ b/windows/msvc/dirent.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_MSVC_DIRENT_H +#define MICROPY_INCLUDED_WINDOWS_MSVC_DIRENT_H // dirent.h implementation for msvc @@ -42,3 +44,5 @@ typedef struct dirent { DIR *opendir(const char *name); int closedir(DIR *dir); struct dirent *readdir(DIR *dir); + +#endif // MICROPY_INCLUDED_WINDOWS_MSVC_DIRENT_H diff --git a/windows/msvc/sys/time.h b/windows/msvc/sys/time.h index 96bca1ccb..a36648beb 100644 --- a/windows/msvc/sys/time.h +++ b/windows/msvc/sys/time.h @@ -23,6 +23,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H +#define MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H // Get the definitions for timeval etc #include + +#endif // MICROPY_INCLUDED_WINDOWS_MSVC_SYS_TIME_H diff --git a/windows/msvc/unistd.h b/windows/msvc/unistd.h index add10c884..87787c3d8 100644 --- a/windows/msvc/unistd.h +++ b/windows/msvc/unistd.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_MSVC_UNISTD_H +#define MICROPY_INCLUDED_WINDOWS_MSVC_UNISTD_H // There's no unistd.h, but this is the equivalent #include @@ -38,3 +40,5 @@ #define SEEK_CUR 1 #define SEEK_END 2 #define SEEK_SET 0 + +#endif // MICROPY_INCLUDED_WINDOWS_MSVC_UNISTD_H diff --git a/windows/realpath.h b/windows/realpath.h index 6f0a29a7e..c7bb3acd7 100644 --- a/windows/realpath.h +++ b/windows/realpath.h @@ -23,5 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_REALPATH_H +#define MICROPY_INCLUDED_WINDOWS_REALPATH_H extern char *realpath(const char *path, char *resolved_path); + +#endif // MICROPY_INCLUDED_WINDOWS_REALPATH_H diff --git a/windows/sleep.h b/windows/sleep.h index 09ad4afdc..6c0c00332 100644 --- a/windows/sleep.h +++ b/windows/sleep.h @@ -23,6 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_WINDOWS_SLEEP_H +#define MICROPY_INCLUDED_WINDOWS_SLEEP_H void init_sleep(void); void deinit_sleep(void); @@ -30,3 +32,5 @@ void msec_sleep(double msec); #ifdef _MSC_VER int usleep(__int64 usec); #endif + +#endif // MICROPY_INCLUDED_WINDOWS_SLEEP_H diff --git a/zephyr/modmachine.h b/zephyr/modmachine.h index 596c59b17..84e4d10a8 100644 --- a/zephyr/modmachine.h +++ b/zephyr/modmachine.h @@ -1,5 +1,5 @@ -#ifndef __MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H__ -#define __MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H__ +#ifndef MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H +#define MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H #include "py/obj.h" @@ -13,4 +13,4 @@ typedef struct _machine_pin_obj_t { uint32_t pin; } machine_pin_obj_t; -#endif // __MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H__ +#endif // MICROPY_INCLUDED_ZEPHYR_MODMACHINE_H