Skip to content
Snippets Groups Projects
Select Git revision
  • 412fc625e887e4cf9fb5f81b7b1dce514e1e25b3
  • master default protected
  • esp32-nimble-wiki
  • rahix/hw-lock-new-mutex
  • dx/somewhat-more-dynamic-config
  • schneider/sdk-0.2.1-7
  • schneider/bsec
  • dx/meh-bdf-to-stm
  • dx/flatten-config-module
  • genofire/ble-follow-py
  • schneider/ble-stability
  • schneider/ble-stability-new-phy
  • add_menu_vibration
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • schneider/fundamental-test
  • schneider/ble-buffers
  • v1.12
  • v1.11
  • v1.10
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
37 results

gpio.c

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    main.c 733 B
    #include "py/runtime.h"
    #include "py/gc.h"
    #include "lib/utils/pyexec.h"
    #include "py/stackctrl.h"
    #include <stdio.h>
    
    #include "max32665.h"
    
    /* Defined in linker script */
    extern void *__StackTop, *__StackLimit;
    extern void *__HeapBase, *__HeapLimit;
    
    int main(void)
    {
    	mp_stack_set_top(&__StackTop);
    	mp_stack_set_limit((mp_int_t)&__StackLimit);
    
    	/* TMR5 is used to notify on keyboard interrupt */
    	NVIC_EnableIRQ(TMR5_IRQn);
    
    	while (1) {
    		gc_init(&__HeapBase, &__HeapLimit);
    
    		mp_init();
    		pyexec_friendly_repl();
    		mp_deinit();
    	}
    }
    
    void gc_collect(void)
    {
    	void *sp = (void *)__get_MSP();
    
    	gc_collect_start();
    	gc_collect_root(
    		sp,
    		((mp_uint_t)&__StackTop - (mp_uint_t)sp) / sizeof(mp_uint_t)
    	);
    	gc_collect_end();
    }