Skip to content
Snippets Groups Projects
Select Git revision
  • fc28ffb4ac1230bb932d63fa285a8fb09eb67fd4
  • main default protected
  • pippin/media_framework
  • release/1.1.1
  • release/1.1.0
  • fpletz/flake
  • sec/auto-nick
  • rahix/flow3rseeds
  • compressor
  • sec/blinky
  • pippin/uhm_flash_access_bust
  • release/1.0.0
  • fm_fix2
  • fm_fix
  • pippin/make_empty_drawlists_skip_render_and_blit
  • pressable_bugfix
  • moon2_gay_drums
  • moon2_applications
  • schneider/application-remove-name
  • anon/webflasher
  • pippin/display-python-errors-on-display
  • v1.1.1
  • v1.1.0
  • v1.1.0+rc1
  • v1.0.0
  • v1.0.0+rc6
  • v1.0.0+rc5
  • v1.0.0+rc4
  • v1.0.0+rc3
  • v1.0.0+rc2
  • v1.0.0+rc1
31 results

machine_adc.h

Blame
  • Forked from flow3r / flow3r firmware
    Source project has a limited visibility.
    frozenmod.c 1.83 KiB
    /*
     * This file is part of the Micro Python project, http://micropython.org/
     *
     * The MIT License (MIT)
     *
     * Copyright (c) 2015 Paul Sokolovsky
     *
     * 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 <string.h>
    #include <stdint.h>
    
    #include "py/lexer.h"
    
    #if MICROPY_MODULE_FROZEN
    
    extern const uint16_t mp_frozen_sizes[];
    extern const char mp_frozen_content[];
    
    mp_lexer_t *mp_find_frozen_module(const char *str, int len) {
        const uint16_t *sz_ptr = mp_frozen_sizes;
        const char *s = mp_frozen_content;
    
        while (*sz_ptr) {
            int l = strlen(s);
            if (l == len && !memcmp(str, s, l)) {
                s += l + 1;
                mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR_, s, *sz_ptr, 0);
                return lex;
            }
            s += l + 1 + *sz_ptr++;
        }
        return NULL;
    }
    
    #endif // MICROPY_MODULE_FROZEN