microscope-ring-light/firmware/main.c

33 lines
532 B
C

#include <stm32f0xx.h>
#include <cmsis/core_cm0.h>
unsigned int i = 0x12345678;
unsigned char c = 2;
extern void sk6812_send_led(uint32_t rgbw);
volatile uint32_t wait_tick = 0;
static void wait_for_ticks(uint32_t ticks)
{
wait_tick = 0;
while (wait_tick < ticks);
}
int main(void)
{
RCC->AHBENR |= RCC_AHBENR_GPIOAEN;
GPIOA->MODER |= (1<<3*2);
SysTick_Config(800000);
while(1) {
__disable_irq();
sk6812_send_led(0x000000FF);
__enable_irq();
wait_for_ticks(30);
}
}
void SysTick_Handler(void) {
wait_tick++;
}