Skip to content
Snippets Groups Projects
Select Git revision
  • 9770116594b60306bb0e460bf9caee56c52faeb1
  • master default
  • analog_clock
  • mem_usage
  • longint_issue
  • more_fonts
  • more_fonts_ng
  • utime_time_ms
  • genofire/ble-personal_state
  • ios-workarounds
  • schneider/maxim-sdk-update
  • rahix/simple_menu
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • koalo/wip/i2c-for-python
  • renze/safe_mode
  • renze/hatchery_apps
  • schneider/fundamental-test
  • koalo/factory-reset
  • msgctl/gfx_rle
  • msgctl/faultscreen
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
29 results

modules.h

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    main.c 1.23 KiB
    /*******************************************************************************
     * License: TBD
     ******************************************************************************/
    
    /***** Includes *****/
    #include "pmic.h"
    #include "leds.h"
    #include "card10.h"
    
    #include "GUI_Paint.h"
    
    #include "tmr_utils.h"
    
    #include <stdio.h>
    #include <stdint.h>
    #include <string.h>
    #include <Heart.h>
    
    int main(void)
    {
        card10_init();
        card10_diag();
    
        Paint_DrawImage(Heart, 0, 0, 160, 80);
        LCD_Update();
    
        for(int i=0; i<11; i++) {
            leds_set_dim(i, 1);
        }
    
        int h = 0;
    
        // Release core1
        core1_start((void *)0x10080000);
    
        while (1) {
            #define NUM     15
            for(int i=0; i<NUM; i++) {
                if(i < 12) {
                    leds_set_hsv(i, (h + 360/NUM * i) % 360, 1., 1./8);
                } else {
                    leds_set_hsv(i, (h + 360/NUM * i) % 360, 1., 1.);
                }
            }
    
            leds_update();
            TMR_Delay(MXC_TMR0, MSEC(10), 0);
            h++;
    
            // Send a txev using `sev` every once in a while to wake up core1
            // and let it do something
            if (h % 100 == 0) {
                printf("core0: Triggering core1 using SEV ...\n");
                __asm volatile("sev");
            }
        }
    }