Skip to content
Snippets Groups Projects
Select Git revision
  • 28775e18aa68a91a6a5bb2003f39d8e604d16ba4
  • master default protected
  • esb_py
  • analog_gpio
  • config
  • esb
  • esb_squashed_nopy
  • card10.cfg
  • fix-intid
  • hwlock_pc
  • jailbreak
  • debug_module
  • gpio_fix
  • fd_ownership
  • moar_blacklist
  • hula
  • mx_printf
  • fileapi
  • dir
  • tidy
  • fatfs-generation
21 results

qstrdefs.h

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    • chris007's avatar
      866e3788
      feat(bme680): Add bme680 support · 866e3788
      chris007 authored and rahix's avatar rahix committed
      Integrated the BME680 Sensor as Python module.  Performs a single read of
      temperature (°C), humidity (% r.h.), air pressure (hPa) and gas resistance
      (Ohm).
      866e3788
      History
      feat(bme680): Add bme680 support
      chris007 authored and rahix's avatar rahix committed
      Integrated the BME680 Sensor as Python module.  Performs a single read of
      temperature (°C), humidity (% r.h.), air pressure (hPa) and gas resistance
      (Ohm).
    runtime.c 51.05 KiB
    /*
     * This file is part of the Micro Python project, http://micropython.org/
     *
     * The MIT License (MIT)
     *
     * Copyright (c) 2013, 2014 Damien P. George
     *
     * Permission is hereby granted, free of charge, to any person obtaining a copy
     * of this software and associated documentation files (the "Software"), to deal
     * in the Software without restriction, including without limitation the rights
     * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     * copies of the Software, and to permit persons to whom the Software is
     * furnished to do so, subject to the following conditions:
     *
     * The above copyright notice and this permission notice shall be included in
     * all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     * THE SOFTWARE.
     */
    
    #include <stdio.h>
    #include <string.h>
    #include <assert.h>
    
    #include "py/mpstate.h"
    #include "py/nlr.h"
    #include "py/parsenum.h"
    #include "py/compile.h"
    #include "py/objstr.h"
    #include "py/objtuple.h"
    #include "py/objlist.h"
    #include "py/objmodule.h"
    #include "py/objgenerator.h"
    #include "py/smallint.h"
    #include "py/runtime0.h"
    #include "py/runtime.h"
    #include "py/builtin.h"
    #include "py/stackctrl.h"
    #include "py/gc.h"
    
    #if 0 // print debugging info
    #define DEBUG_PRINT (1)
    #define DEBUG_printf DEBUG_printf
    #define DEBUG_OP_printf(...) DEBUG_printf(__VA_ARGS__)
    #else // don't print debugging info
    #define DEBUG_printf(...) (void)0
    #define DEBUG_OP_printf(...) (void)0
    #endif
    
    const mp_obj_module_t mp_module___main__ = {
        .base = { &mp_type_module },
        .name = MP_QSTR___main__,
        .globals = (mp_obj_dict_t*)&MP_STATE_VM(dict_main),
    };
    
    void mp_init(void) {
        qstr_init();
        mp_stack_ctrl_init();
    
        // no pending exceptions to start with
        MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL;
    
    #if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF
        mp_init_emergency_exception_buf();