Skip to content
Snippets Groups Projects
Select Git revision
  • 017ef3f9a498f14ae7f6e33e9fe6d35b7f8dabf1
  • 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

main.c

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");
            }
        }
    }