Skip to content
Snippets Groups Projects
Select Git revision
  • 68720f2590b2fbe87a866c593de2b9b14d0796db
  • master default protected
  • electrodes
  • b-butwasntthisaboutchaos
  • fontcleanup
  • nodisplaynoproblem
  • fleur/improved_font_rendering
  • fleur/portexpander_fix
  • fleur/transprint
  • fleur/florapower
  • fleur/comicsans
  • fleur/leds
  • fleur/buttons
13 results

meson.build

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    main.c 2.99 KiB
    #include "modules/modules.h"
    #include "modules/log.h"
    #include "modules/filesystem.h"
    #include "card10-version.h"
    
    #include "FreeRTOS.h"
    #include "task.h"
    #include "mxc_delay.h"
    
    #include <stdlib.h>
    #include <string.h>
    
    int main(void)
    {
    	LOG_INFO("startup", "Epicardium startup ...");
    	LOG_INFO("startup", "Version " CARD10_VERSION);
    
    	LOG_DEBUG("startup", "Initializing hardware ...");
    	hardware_early_init();
    
    	char *version_buf = CARD10_VERSION;
    	epic_disp_print(0, 5, "epicardium:", 0xffff, 0x0000);
    	epic_disp_print(0, 24, version_buf, 0xffff, 0x0000);
    	epic_disp_update();
    	mxc_delay(2000000);
    
    	LOG_DEBUG("startup", "Initializing tasks ...");
    
    	/* Serial */
    	if (xTaskCreate(
    		    vSerialTask,
    		    (const char *)"Serial",
    		    configMINIMAL_STACK_SIZE * 2,
    		    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();
    	}
    
    	/* BHI160 */
    	if (xTaskCreate(
    		    vBhi160Task,
    		    (const char *)"BHI160 Driver",
    		    configMINIMAL_STACK_SIZE * 2,
    		    NULL,
    		    tskIDLE_PRIORITY + 1,
    		    NULL) != pdPASS) {
    		LOG_CRIT("startup", "Failed to create %s task!", "BHI160");
    		abort();
    	}
    
    	/* MAX30001 */
    	if (xTaskCreate(
    		    vMAX30001Task,
    		    (const char *)"MAX30001 Driver",
    		    configMINIMAL_STACK_SIZE * 2,
    		    NULL,