Skip to content
Snippets Groups Projects
Select Git revision
  • bb39f9b5af8146e7bbb29b41fc9d008bcc3d3152
  • master default protected
  • button_gestures
  • ecg-button-gestures
  • fix-bhi160-axes
  • ecg-bpm-counter
  • patch-1
  • genofire/leds_rgb_get_state
  • genofire/rockets-state
  • genofire/ble-follow-py
  • hauke/ble-cleanups
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • genofire/haule-ble-fs-deactive
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • ios-workarounds
  • schneider/fundamental-test
  • schneider/ble-buffers
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
33 results

overview.rst

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    main.c 2.09 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>
    
    /***** Definitions *****/
    
    /***** Globals *****/
    static __attribute__((unused)) const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE};
    
    int main(void)
    {
        int count = 0;
    
        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 __attribute__((unused)) h = 0;
        while (1) {
    #if 0
    
            #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++;
    #endif
    #if 1
            pmic_set_led(0, 31);
            pmic_set_led(1, 0);
            pmic_set_led(2, 0);
            TMR_Delay(MXC_TMR0, MSEC(200), 0);
    
            pmic_set_led(0, 0);
            pmic_set_led(1, 31);
            pmic_set_led(2, 0);
            TMR_Delay(MXC_TMR0, MSEC(200), 0);
    
            pmic_set_led(0, 0);
            pmic_set_led(1, 0);
            pmic_set_led(2, 31);
            TMR_Delay(MXC_TMR0, MSEC(200), 0);
    
            pmic_set_led(0, 0);
            pmic_set_led(1, 0);
            pmic_set_led(2, 0);
            //TMR_Delay(MXC_TMR0, MSEC(200), 0);
    #endif
    #if 0
            //TMR_Delay(MXC_TMR0, MSEC(600), 0);
            GPIO_OutSet(&motor_pin);
            TMR_Delay(MXC_TMR0, MSEC(30), 0);
            GPIO_OutClr(&motor_pin);
            TMR_Delay(MXC_TMR0, MSEC(200), 0);
    #endif
    #if 0
            LED_Off(0);
            TMR_Delay(MXC_TMR0, MSEC(500), 0);
            LED_On(0);
            TMR_Delay(MXC_TMR0, MSEC(500), 0);
    #endif
    #if 1
            TMR_Delay(MXC_TMR0, MSEC(1000), 0);
            printf("count = %d\n", count++);
    #endif
        }
    }