Skip to content
Snippets Groups Projects
Select Git revision
  • 96d3843fdec20157ddb16abbc849a406d4f11076
  • master default protected
  • fix-warnings
  • tvbgone-fixes
  • genofire/ble-follow-py
  • schneider/ble-stability-new-phy-adv
  • schneider/ble-stability
  • msgctl/gfx_rle
  • 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
  • schneider/maxim-sdk-update
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • 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
36 results

qstrdefs.h

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    lifecycle.c 8.90 KiB
    #include "epicardium.h"
    #include "os/core.h"
    #include "modules/modules.h"
    #include "os/config.h"
    #include "os/mutex.h"
    #include "user_core/user_core.h"
    #include "api/dispatcher.h"
    #include "l0der/l0der.h"
    
    #include "card10.h"
    
    #include "FreeRTOS.h"
    #include "task.h"
    
    #include <assert.h>
    #include <string.h>
    #include <stdbool.h>
    #include <stdbool.h>
    
    #define PYCARDIUM_IVT (void *)0x100a0000
    #define BLOCK_WAIT pdMS_TO_TICKS(1000)
    /*
     * Loading an empty filename into Pycardium will drop straight into the
     * interpreter.  This define is used to make it more clear when we intend
     * to go into the interpreter.
     */
    #define PYINTERPRETER ""
    
    static TaskHandle_t lifecycle_task = NULL;
    static struct mutex core1_mutex    = { 0 };
    
    enum payload_type {
    	PL_INVALID       = 0,
    	PL_PYTHON_SCRIPT = 1,
    	PL_PYTHON_DIR    = 2,
    	PL_PYTHON_INTERP = 3,
    	PL_L0DABLE       = 4,
    };
    
    struct load_info {
    	bool do_reset;
    	enum payload_type type;
    	char name[256];
    };
    static volatile struct load_info async_load = {
    	.do_reset = false,
    	.name     = { 0 },
    	.type     = PL_INVALID,
    };
    
    /* Whether to write the menu script before attempting to load. */
    static volatile bool write_menu = false;
    static bool execute_elfs        = false;
    
    /* Helpers {{{ */
    
    /*
     * Check if the payload is a valid file (or module) and if so, return its type.
     */
    static int load_stat(char *name)
    {
    	size_t name_len = strlen(name);
    
    	if (name_len == 0) {
    		return PL_PYTHON_INTERP;
    	}
    
    	struct epic_stat stat;
    	if (epic_file_stat(name, &stat) < 0) {
    		return -ENOENT;