Skip to content
Snippets Groups Projects
Select Git revision
  • 43f83831f38a42c39de83e912e89c508ccbcf5fa
  • main default protected
  • blm_dev_chan
  • release/1.4.0 protected
  • widgets_draw
  • return_of_melodic_demo
  • task_cleanup
  • mixer2
  • dx/fb-save-restore
  • dx/dldldld
  • fpletz/flake
  • dx/jacksense-headset-mic-only
  • release/1.3.0 protected
  • fil3s-limit-filesize
  • allow-reloading-sunmenu
  • wifi-json-error-handling
  • app_text_viewer
  • shoegaze-fps
  • media_has_video_has_audio
  • fil3s-media
  • more-accurate-battery
  • v1.4.0
  • v1.3.0
  • v1.2.0
  • v1.2.0+rc1
  • 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
35 results

modmachine.c

Blame
  • main.c 1.91 KiB
    #include "modules/modules.h"
    #include "modules/log.h"
    #include "modules/filesystem.h"
    #include "card10-version.h"
    
    #include "FreeRTOS.h"
    #include "task.h"
    
    #include <stdlib.h>
    #include <string.h>
    
    int main(void)
    {
    	LOG_INFO("startup", "Epicardium startup ...");
    	LOG_INFO("startup", "Version " CARD10_VERSION);
    
    	LOG_INFO("startup", "Initializing hardware ...");
    	hardware_early_init();
    
    	LOG_INFO("startup", "Initializing tasks ...");
    
    	/* Serial */
    	if (xTaskCreate(
    		    vSerialTask,
    		    (const char *)"Serial",
    		    configMINIMAL_STACK_SIZE,
    		    NULL,
    		    tskIDLE_PRIORITY + 1,
    		    NULL) != pdPASS) {
    		LOG_CRIT("startup", "Failed to create %s task!", "Serial");
    		abort();
    	}
    
    	/* PMIC */
    	if (xTaskCreate(
    		    vPmicTask,
    		    (const char *)"PMIC",
    		    configMINIMAL_STACK_SIZE,
    		    NULL,
    		    tskIDLE_PRIORITY + 4,
    		    NULL) != pdPASS) {
    		LOG_CRIT("startup", "Failed to create %s task!", "PMIC");
    		abort();
    	}
    
    	/* API */
    	if (xTaskCreate(
    		    vApiDispatcher,
    		    (const char *)"API Dispatcher",
    		    configMINIMAL_STACK_SIZE * 16,
    		    NULL,
    		    tskIDLE_PRIORITY + 2,
    		    &dispatcher_task_id) != pdPASS) {
    		LOG_CRIT(
    			"startup",
    			"Failed to create %s task!",
    			"API Dispatcher"
    		);
    		abort();
    	}
    
    	/* BLE */
    	if (ble_shall_start()) {
    		if (xTaskCreate(
    			    vBleTask,
    			    (const char *)"BLE",
    			    configMINIMAL_STACK_SIZE * 10,
    			    NULL,
    			    tskIDLE_PRIORITY + 1,
    			    NULL) != pdPASS) {