Skip to content
Snippets Groups Projects
Select Git revision
  • 9251ea69f7bc59f94436b71b7c89bcb9a671273f
  • master default protected
  • bme680_demoapp
  • bme680
  • rahix/simple_menu
  • genofire/ble-rewrite
  • rahix/batt
  • schneider/bonding2
  • renze/safe_mode
  • renze/hatchery_apps
  • schneider/fundamental-test
  • koalo/factory-reset
  • ios-workarounds
  • msgctl/gfx_rle
  • msgctl/faultscreen
  • msgctl/textbuffer_api
  • schneider/bonding
  • schneider/bootloader-update-9a0d158
  • schneider/bsec
  • rahix/bma
  • rahix/bhi
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
26 results

meson.build

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    main.c 708 B
    #include "py/runtime.h"
    #include "py/gc.h"
    #include "lib/utils/pyexec.h"
    
    #include "max32665.h"
    
    static char *stack_top;
    static char heap[4096];
    
    int main(void)
    {
    	/* TODO: Replace this with a proper heap implementation */
    	int stack_dummy;
    	stack_top = (char *)&stack_dummy;
    
    	/* TMR5 is used to notify on keyboard interrupt */
    	NVIC_EnableIRQ(TMR5_IRQn);
    
    	while (1) {
    		gc_init(heap, heap + sizeof(heap));
    
    		mp_init();
    		pyexec_friendly_repl();
    		mp_deinit();
    	}
    }
    
    void gc_collect(void)
    {
    	/* TODO: Replace this with a proper heap implementation */
    	void *dummy;
    
    	gc_collect_start();
    	gc_collect_root(
    		&dummy,
    		((mp_uint_t)stack_top - (mp_uint_t)&dummy) / sizeof(mp_uint_t)
    	);
    	gc_collect_end();
    }